| PetesProjects: Backing up With Bash | ||
|
<<< Backing Up Home
![]() Files that are described here: The bash script that creates the actual backup is called backmeup. The diagram you see above shows in a general way how it works:
(Note: if you choose to use bu2_py in place of bu2 for the incremental backup script, be sure to change the name of the file that is touched at the end of the bash script from bu2 to bu2_py.) Because of the defaults in the script, to do a full backup to a file called backup.tar.gz, using a backuplist, just type "backmeup" with no command line arguments. When the gzipped tar file is created, the script will insert the current date into the file name (for example, backup_12-27-03.tar.gz). The first line indicates this is a bash script. The next line sets the current working directory to the environmental variable, $HOME. The tar command will include paths that are relative to the current working directory. The next two lines provide the default names (and paths relative the the current working directory) of the backup filename, and the list of files and directories to back up. The variable called full is used to determine whether the script should do a full backup or an incremental backup. This is left alone when doing full backups. So to do full backups, just modify the move to the preferred directory and the names of the backup file and file list, and just say "backmeup." Backmeup will also take three command line parameters: the name of the backup, the name of the file list, and a flag that indicates whether to do a full or incremental backup. So if you want to change the name of the backup and/or file list on the command line, just add those names on the command line. Add a further parameter, which should be anything but "1" if you wish to do an incremental backup. But that third parameter is not intended to be typed on to the command line. Read on to learn how incremental backups are done.
|
|
|