Backup/restore can be as simple as a one line script. I prefer tar(1), so this shows both backup/restore of /home: # cd / && tar -cf- home > "file or device"
restore of /home: # cd / && tar -xf- < "file or device"
Now depending how/were this data is physically stored, I usually pipe it through ccrypt. Example: # cd / && tar -cf- home | ccencrypt -k "keyfile" > "file or device"
of course make sure you keep the "keyfile" secret. Note, you can also add a pipe through one of the compression utilities, example: gzip(1).
I'm also looking for a backup script that will allow me to use dump on a weekly basis to backup my entire root file system, put the date in the filename and then have 4 weekly backups (so after the 5th week the first file is overwritten). Is this easily accomplished with a script and a cron job?
Yes it is. I don't see any problem here, except if you are backing up the / you will have recursion on the backup itself. Anyway, use date(1) to get the date (i-th day) and append it to a string that will be the filename, then tar(1) against such file. Place all in cron and it is done.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.