Go to TogaWare.com Home Page. GNU/Linux Desktop Survival Guide
by Graham Williams
Duck Duck Go

Simple Backup

With the philosophy of keeping it simple, one approach is to simply use find and tar to find all changes since your last backup and put them into a compressed tar file. You can do daily, 7 day, or 32 day incremental backups, with a full backup weekly, monthly, or quarterly. You can create a script, perhaps called do-backup.sh in /root, as root:

  #!/bin/bash
  DATE=$(date +%Y-%m-%d-%R | tr -d ':')
  DAYS=32
  
  cd / 
  find home etc usr/local -type f -mtime -${DAYS} \
  | egrep -iv '(.bak|.mp3|cache|trash|~$)' \
  | tar zcvf /root/backup-${DATE}-last-${DAYS}.tgz -T -

You can use cron to perform the daily, weekly, or monthly incremental backups. Refer to http://www.linux-backup.net/scripts/Backup.pland http://www.Linux-Backup.net/App for further information.

Note that tar can handle incremental backups with the -g (and -M, for multiple tapes) options.


Support further development by purchasing the PDF version of the book.
Other online resources include the Data Science Desktop Survival Guide.
Books available on Amazon include Data Mining with Rattle and Essentials of Data Science.
Popular open source software includes rattle and wajig.
Hosted by Togaware, a pioneer of free and open source software since 1984.
Copyright © 1995-2020 Togaware Pty Ltd. . Creative Commons ShareAlike V4.