Skip to content
Advertisement

Tag: rsync

Linux Shell Script – Mounting and Backing Up Files

I’m writing my first shell script. I want to check if a filesystem is mounted. If so, then backup the documents from my main drive to the backup that is mounted. If not, mount the filesystem, then backup the documents. I executed the script, yet all I got was a lot of text. It didn’t perform as I wanted. Did

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 exactly that (creation of

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 According to your description, you

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 dateTimeFolder’s schedule folder that I have included? Answer If I understand the situation correctly,

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 get an error like that: Maybe you have some issue with your id_rsa If you

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 so when I tried doing a cat release.txt to view

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 file /var/tmp/baz.sql, but instead to pipe the output of mysqldump directly

Advertisement