A reader writes:
“My question concerns backup.sh (script #56 in the book Wicked Cool Shell Scripts). I am a little confused how to set
up my directory list file INITIALLY to use for the backup script to work. Do
you have to do a -f (full backup) first, then I’m free to incrementally backup
as desired? Even then I’m only interested in backing some key directories not
my whole home space….”
Ideally you should start with a full backup, but the script can work with incremental backups by themselves.
To do that you would need to fool the script into thinking that you’ve done that first full backup by manually creating a starting ‘timestamp’ file.
You can do this by entering the following two commands at the prompt:
timestamp="$(date +'%m%d%I%M')" touch -t $timestamp $HOME/.backup.timestamp
That should take care of things and you can run the incremental backups starting at that point.
But I nonetheless recommend at least one full backup rather than circumventing it. You can never have too many backups.