Rsync upload local files without replacing remote files Rumi, May 27, 2023May 27, 2023 Disclaimer: This is basically one way sync- use at your own risk and dry run before any production deployment. Suppose you have a list of files on a remote host, some of which already exist locally. What you want is to transfer only those files that are not found locally. If you blindly run scp with wildcard, it would fetch all remote files (existing as well as non-existing files), and overwrite existing local files. You want to avoid this. In another similar situation, you may want to upload local files to a remote site, but without replacing any remote files. Using rsync: If the local and remote hosts have rsync installed, using rsync will be the easiest way to copy only new files over, since rsync is designed for incremental/differential backups. In this case, you need to explicitly tell rsync to skip any existing files during sync. Otherwise, rsync will try to use file modification time to sync two hosts, which is not what you want. To download all remote files (over SSH) while skipping existing local files: $ rsync -av --ignore-existing user@remote_host:/path/to/remote/directory/* /path/to/local/directory/ Similarly, to upload all local files (over SSH) without overwriting any duplicate remote files: $ rsync -av --ignore-existing /path/to/local/directory/* user@remote_host:/path/to/remote/directory/ Sample command- rsync -av --ignore-existing /opt/jf/tv-in/* root@123.45.67.89:/storage/tv-in Ref: https://www.xmodulo.com/skip-existing-files-scp.html Related Administrations Collected Articles Configurations (Linux) rsync
Two Default Gateways on One System May 21, 2015 Problem Description You have built two or more network cards into one Linux system and each of these cards has its own default gateway. By default, you can only have one default gateway on a system. The case described would lead to asynchronous routing, whereby the router would reject the… Read More
Setting up PHPMyAdmin to Usermin Module June 12, 2008 Webmin and Usermin are simply great- but it lacks the most widely used PhpMyadmin support! However, after googling for a while I got a solution for this. First need to download and setup the usermin module- here’s the URL for wbm package- http://awstats.sourceforge.net/files/phpmyadmin-1.0.wbm How to install PHPMyAdmin Module ? Go… Read More
Install VPN PPTP Server on CentOS October 4, 2013March 29, 2017 In this tutorial, I will use pptp as protocol to connect to VPN server using a username and password, with 128 bit MPPE encryption. Variable as below: OS: CentOS 6 64bit VPN server: 209.85.227.26 VPN client IP: 209.85.227.27 – 209.85.227.30 VPN username: vpnuser Password: myVPN$99 Install ppp via yum: $… Read More