0

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

12
  • 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
    Commented Jan 31, 2014 at 15:04
  • Have you tried rsync? Or cp? Why 10 minutes?
    – terdon
    Commented Jan 31, 2014 at 15:04
  • @terdon because the sysadmin will reboot and format the machine in 10 minutes
    – RSFalcon7
    Commented Jan 31, 2014 at 15:07
  • you sure you need full backup instead of just the basic?
    – Braiam
    Commented Jan 31, 2014 at 15:08
  • 1
    related: unix.stackexchange.com/questions/553/…
    – slm
    Commented Jan 31, 2014 at 16:01

2 Answers 2

2

Done in the server with:

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

More info here.

2
  • 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!
    – DavidGamba
    Commented Jan 31, 2014 at 15:17
  • I will dig into those (and other) options with more time, probably there are lots of option that could helped.
    – RSFalcon7
    Commented Jan 31, 2014 at 15:27
0

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/

#!/bin/bash
#setup
folder=$(date +%Y-%m-%d)
mkdir $folder
cd $folder

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

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

#delete original
sudo rm -rf "$folder"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .