Quote:
Originally Posted by Toadman
Will the file names always be drive.img.bz2 or can they be named something else? Since I'll be doing 2 drives can't have two files with the same name.
|
With the command;
Code:
dd if=/dev/sda bs=1M | bzip2 -9 > /path/to/dir/drive.img.bz2
You can replace "
/path/to/dir/drive.img.bz2" with whatever you want. Just as long as it's a valid path, and a filename that isn't currently in use.
If you wanted to throw that command in a script, I would suggest something like this;
Code:
dd if=/dev/sda bs=1M | bzip2 -9 > /path/to/dir/backup_image-`date +%Y_%m_%d-%H%`.img.bz2
Which would result in an output file named "
backup_image-2010_09_05-1750.img.bz2" in a directory (that should exist beforehand) named "
/path/to/dir".
NOTE: the 'backtick' character (a reverse aphostropy) wraps the "
date" command, causing a shell (such as
bash) to run *
that* command first)
Quote:
Originally Posted by Toadman
Can dd be used to make incrimental backups of for instance changed files since the last backup? For instance if a newer version of wget is installed or is a complete backup required?
|
The "
dd" command is a block-level command, and works 'underneath' files. As such, it doesn't understand complex things like time/date stamps, directories, filesystem types or even which Operating System is/was using the disk.
So, no, with this method, it's the whole enchilada, every byte (even the empty ones). For example; Have a 1GB filesystem? Then an uncompressed (i.e: "not using
bzip2") image file will be exactly 1GB.
If you want incremental backups, than you're going to have to start looking at an actual application, rather than a few commands strung together with some clever shell usage. (Keep in mind though, this sort of thing is good for weekly/monthly backups, especially ones that go offsite)
For something that can do incremental and/or cumulative backups, as well as full backups,
you might want to consider some of these. Note that not all of them are going to be OpenSource/Free software.
Happy Backing-up!
P.S: Note that you do
NOT have a "backup solution" until you've properly done a restore test!