Mindtwist.de

...let your mind twist!

How to create a reliable full backup to a remote ftp server

Using dump for Linux backups has saved adminisrators for a long time. This little howto shows you how to easily setup a full backup of your root filesystem to a remote ftp server.

Howto

Simply create the following files:

# cat ftp 
host ftp.example.com
user myuser
# cat pwd
mypassword

Then run the following command:

# dump -a -0 -h 0 -f - / | gzip -c | openssl enc -bf-cbc -pass file:/root/.backup/pwd |
 ncftpput -S .tmp -c -f /root/.backup/ftp /backup_root_0.dump
DUMP: Date of this level 0 dump: Mon Feb 22 22:51:54 2010
DUMP: Dumping /dev/sda1 (/) to standard output
DUMP: Label: /
DUMP: Writing 10 Kilobyte records
DUMP: mapping (Pass I) [regular files]
DUMP: mapping (Pass II) [directories]
DUMP: estimated 990068 blocks.
DUMP: Volume 1 started with block 1 at: Mon Feb 22 22:51:55 2010
DUMP: dumping (Pass III) [directories]
DUMP: dumping (Pass IV) [regular files]
DUMP: Volume 1 completed at: Mon Feb 22 22:53:31 2010
DUMP: Volume 1 992390 blocks (969.13MB)
DUMP: Volume 1 took 0:01:36
DUMP: Volume 1 transfer rate: 10337 kB/s
DUMP: 992390 blocks (969.13MB)
DUMP: finished in 96 seconds, throughput 10337 kBytes/sec
DUMP: Date of this level 0 dump: Mon Feb 22 22:51:54 2010
DUMP: Date this dump completed: Mon Feb 22 22:53:31 2010
DUMP: Average transfer rate: 10337 kB/s
DUMP: DUMP IS DONE

To restore the backup, you may download the backup files from ftp and use the following command:

cd /path/to/extract/the/files/ && zcat /tmp/backup_root_0.dump | restore -v -r -f -
 

Linux Magazine

Linux Magazine News
  • Rocks Releases Mamba

    The latest version of Rocks cluster distribution – an open source toolkit for real and virtual clusters – has been released.

  • PowerTOP Releases v2.0

    PowerTOP releases v2.0 of its Linux tool, with improved diagnostics and user interface.