I need to backup all my data from a server (in 10 minutes), preferably keeping the symlinks.

  • 1
    I suppose that since you used rsync tag you know about rsync. You could also make a image of the disk with dd. – Braiam Jan 31 '14 at 15:04
  • Have you tried rsync? Or cp? Why 10 minutes? – terdon Jan 31 '14 at 15:04
  • @terdon because the sysadmin will reboot and format the machine in 10 minutes – RSFalcon7 Jan 31 '14 at 15:07
  • you sure you need full backup instead of just the basic? – Braiam Jan 31 '14 at 15:08
  • 1
    related: unix.stackexchange.com/questions/553/… – slm Jan 31 '14 at 16:01

Done in the server with:

rsync -avx --progress ~ user@backup-host:~/backup

More info here.

  • 1
    I also like to add --delete otherwise the backup just grows with things you don't need anymore. Make sure to use that option with care! – DavidG Jan 31 '14 at 15:17
  • I will dig into those (and other) options with more time, probably there are lots of option that could helped. – RSFalcon7 Jan 31 '14 at 15:27

I personally use this script to get a systemwide backup from my server.

Notice the sudo in front of rsync to make sure groups, users and permissions are set properly.

Of cause downloading a complete server might take some time. You may want to change the folder by changing serv:/ with serv:/home/myuser/important/

folder=$(date +%Y-%m-%d)
mkdir $folder
cd $folder

sudo rsync -aPuzh --exclude='/proc' --exclude='/dev' --exclude='/tmp' --exclude='/sys'  --exclude='*/.cache' serv:/ ./

sudo tar -czf "$folder.tar.gz" *
sudo mv "$folder.tar.gz" ../
cd ..

#delete original
sudo rm -rf "$folder"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.