I'm running Ubuntu Server and I'm looking for an efficient way of performing nightly backups of particular directories using cron. However, since the computer isn't always on, I'd like it to just run when the computer is on and to keep the last 5 backups. Would I need to use a bash script of some kind to achieve this?
rsync is an amazing backup tool that has inspired a lot of backup utilities, from easy bash scripts as referenced above to GUI applications that handle the grunt work for you. For workstations/toys, my favorite backup utility has got to be deja-dup, just for the straightforwardness and the simplified UI that i can comfortably recommend to my parents (the UI standard by which all applications must be judged :P ).
For headless systems, I'd go with rdiff-backup or duplicity, the app that powers deja-dup's backend.