[SOLVED] rsync hanging within minutes.

VladDorn1234

New Member
Joined
Dec 16, 2018
Messages
12
Reaction score
9
Credits
0
Hello everyone. I am using arch linux and since i could not currently use timeshift I decided to just manually back up my system with rsync if there is any problems in the future so i will have backup. I tried to use rsync and every time I used the command within about 3-5 minutes of it backing up the specified files it would hang for hours and would no longer work. to fix this problem I also tried graphical front ends such as luckybackup and grsync to see if those would also have the same problem and they did. I ran lucky backup as super user and also ran the regular rsync command under root when the original time i tried it just using sudo did not work. I am very confused as to what could be going on.

the rsync configuration I used is as follows:
Code:
sudo rsync -aAXv --delete --exclude=/dev/* --exclude=/proc/* --exclude=/sys/* --exclude=/tmp/* --exclude=/run/* --exclude=/mnt/* --exclude=/media/*
 --exclude="swapfile" --exclude="lost+found" --exclude=".cache" --exclude="Downloads" --
exclude=".ecryptfs" /source /destination   (keep in mind /source and /destination are just written here for example, i did not forget to put my actual source and destination when executing the actual command. )
 


Hello everyone. I am using arch linux and since i could not currently use timeshift I decided to just manually back up my system with rsync if there is any problems in the future so i will have backup. I tried to use rsync and every time I used the command within about 3-5 minutes of it backing up the specified files it would hang for hours and would no longer work. to fix this problem I also tried graphical front ends such as luckybackup and grsync to see if those would also have the same problem and they did. I ran lucky backup as super user and also ran the regular rsync command under root when the original time i tried it just using sudo did not work. I am very confused as to what could be going on.
Are you sure it is hanging? Add a --progress in there.. maybe stuck on a big file.
Yes I am sure it is hanging because I forgot to mention I also tried this before too and when it would get to a specific point (it always happens with different files never the same one or group of one but its always a file in the usr directory the progress will not even show and nothing will happen.
 
My two cents is that your trouble is likely in the syntax of your rsync commands. I would suggest that instead of trying to backup your entire root (/) with the exceptions of the many --exclude statements... that you only give commands for what you DO WANT, not what you DON'T WANT. I would further suggest to start small and then build your backup command out more fully to make sure it works at each step and with each new directory. Since /usr is giving your trouble, I would probably use that first with a very basic structure, like this:
Code:
rsync -av /usr /destination-path

Especially note that there is no trailing / on the source.... so /usr and not /usr/. That will copy the directory itself and all the contents. If you put the trailing / it will only copy the loose files inside (and create quite a mess in your destination).

I'm not quite sure that /usr is a useful backup for you, but that is your decision. I ran a test of the above command on my own /usr directory... it was over 330,000 files and about 6 GB. Also, the command as given above neglected to copy 8 files (yes, only 8 out of over 330,000) due to permission problems. I ran it again with sudo and then it copied every file, but that makes root the owner of the backed up directory. I did this backup on the same hard drive and it took about 7-8 minutes... so it would likely be slower on an external hard drive, or even worse over a network connection.

For my own personal rsync backup solution, I join several rsync commands together (concatenate) with && similar to this:
Code:
rsync --delete -avhs "/home/stan/Documents/MyKeePass" "/media/stan/DBB0-4F8C/" &&
rsync --delete -avhs "/home/stan/Documents/HomeBank" "/media/stan/DBB0-4F8C/" &&
rsync --delete -avhs "/home/stan/Documents/ALL_eStatements" "/media/stan/DBB0-4F8C/"

I simply copy the commands from a text file (a BASH script would work nicely too) and paste into a terminal after making sure that I have the correct flash drive inserted (the destination: /media/stan/DBB0-4F8C/). The --delete option means that if I delete a file in the source between backups, then it will be deleted in the destination also on my next backup. Not everyone wants to do this, so you should consider the consequences of that option. But for me, it means that my backup is always perfectly synchronized with the source, which is what I want.

Rsync is very powerful, but also very complex, and I am far from an expert on using it. The man page offers full details, but I found a lot of good info on rsync examples by Googling around the web. Good luck!

Cheers
 
I am using arch linux and since i could not currently use timeshift

It seems that Timeshift is available in the AUR. Or building from source code should be possible. I'm not an Arch user, nor Timeshift, so maybe there is a better way than rsync.

Cheers
 
It seems that Timeshift is available in the AUR.

Yes, it is.

Although I use many Arch-based Distros, 12 or more, I only have the one Arch so far, in a Virtual Machine under Swagarch. I suppose I can check if I can install Timeshift within that.

If I learn anything, I will report back.

Wiz

Gosh, Stan, you have a lot of two cents in those pockets of yours :)
 
Hello, thank you all again for all your help and thank you atanere, for getting into so much detail on this particular issue. I have since updated my mirror list on my system and timeshift worked with no problems and downloaded and installed with no problems, appears it was just down from the aur for a few days but is accessible again. tested the backup and everything works great!
 
Geez, talk about Wizard arriving after the gate has been opened and the horse has bolted. :D

I went into Arch on the Virtualbox install I have under SwagArch, and sure enough I had installed Timeshift on it to see if it worked, 6 or more months ago. Command used then was

Code:
yaourt - S timeshift

... where yaourt is being superceded now by

yay (yet another yaourt)

... but for The Viewers using Arch-based Distros, a number of them are now including Timeshift in their Repos, so if you like, first try

Code:
sudo pacman -S timeshift

If no joy, then try yaourt or yay.

Yaourt and yay do not require to be prefaced with sudo, they will tell you if they need it and when.

Good news, Vlad :)

I regard Timeshift like an old Amex advertisement featuring Karl Malden but paraphrased to

"Timeshift - don't leave home without it!"

Cheers

Wizard
 

Members online


Latest posts

Top