Backups

to backup something locally

# cd to the right directory to back up
sudo tar cvjf /out/file.tar.bz2 --one-file-system --exclude=FILENAME .

If you want to run the backup on a remote system and store it locally without making a remote temporary file, you should try something like this:

ssh root@192.168.0.8 "cd / ; tar cvz --one-file-system ." > lefschetz-root-backup-2006-5-30.tar.gz

You can either compress it locally or remotely-- filter through gzip or bzip locally, and remove the option from tar which is run remotely.

Excluding Files

I found that you don't want to have a trailing slash. The begginning part should be what is logical:

cd /
tar cjv --exclude-from=FILE .

FILE =

var/cache/apt/archives

Some useful backup commands

# zarankiewicz root
cd /home/
time sudo tar cjvf /media/sdb2/backup/zarankiewicz/zarankiewicz-home-backup-2005-02-02.tar.bz2 --one-file-system --exclude-from=richard/backup-home-excludelist .

# zarankiewicz home
cd /
time sudo tar cjvf /media/sdb2/backup/zarankiewicz/zarankiewicz-root-backup-2005-02-03.tar.bz2 --one-file-system --exclude-from=home/richard/rkd/comp/backup/excludelist-root-all .

# zarankiewicz boot
cd /boot/
time sudo tar cjvf /media/sdb2/backup/zarankiewicz/zarankiewicz-boot-backup-2005-02-03.tar.bz2 --one-file-system .

-- CategoryDebianNotes

DebianNotes/Tar (last edited 2008-03-10 01:38:15 by localhost)