Skip to content

Tag: rsync

Why does rsync create ~ files?

I run the following daily crontab: It creates these files: Anyone know why it creates these tilde (~) files? Also anyone know a quick way to delete them? Answer Anyone know why it creates these tilde (~) files? That would be because of the -b option you are specifying to rsync. Its purpose is to request exact…

Migrate data from one mount to another

In Azure Linux VM we have an LVM that holds the data(1.2TB) of a live application. For some reasons, we want to migrate the data of the application to another LVM and decommission the old one. We want to achieve this with minimal downtime. What switches/method we can use using rsync to achieve this? Answer Ac…

Complex rsync filtering (includes and excludes)

I got directories and files that look like this I only want to copy the 20170409_*/schedule, 20170410_*/schedule, 20170411_*/schedule folders and contents. This mostly works: However this also copies the following: How do I omit the files and the dateTimeFolders I haven’t included and only get the dateT…

Redirect the password prompt alert

Is it possible to redirect password prompt alert to a file or silence it? [lnx51 ~]$ ssh root@192.168.1.1 root@192.168.1.1’s password: Answer To avoid password authentication you can use next sentence: This disable ‘manual’ authentication but you need another method to login, if not you will…

Background rsync and pid from a shell script

I have a shell script that does a backup. I set this script in a cron but the problem is that the backup is heavy so it is possible to execute a second rsync before the first ends up. I thought to launch rsync in a script and then get PID and write a file that script checks if the

Rsync not transferring the changes

I am trying to sync this local file (release.txt) to a server (verlis) in which I have ssh into, into the same path directory in which it also contains the same file. And so, I did the following: ssh verlis rsync -av /tools/packageA/release.txt verlis:/tools/packageA/release.txt The process was very fast and …

Using rsync command with email address

I am trying to use rsync on my mac. When I normally type out a command I am only using user for a username. However, this time my USERNAME is mail@user.com. How do I use an email address as a username in an rsync command? The command I am trying to do is The other option I could work with

How to make rsync read SRC from STDIN?

I want to dump my MySQL database and make daily backups with rsync. First approach I came up with is something like mysqldump -ufoo -pbar baz > /var/tmp/baz.sql && rsync /var/tmp/baz.sql /backup/ && rm /var/tmp/baz.sql. Then I started to wonder if it is possible not to use the temporary fil…