Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
1  
Do you have a place to already backup too? Could you expand more on your infrastructure? –  Marco Ceppi Oct 11 '10 at 14:18
    
Thanks Marco, for the record I'm just running the server on my home network and was looking at backing up locally initially with a view to backing up to a Network Drive which I'm now working on. –  conorgriffin Oct 11 '10 at 23:59
add comment

2 Answers

up vote 3 down vote accepted

You can use tar and rsync for a combination of full & incremental backups and there is a tutorial here that sets it up to do nightly / weekly backups using cron.

share|improve this answer
add comment

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 back-up 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 w/ rdiff-backup or duplicity, the app that powers deja-dup's backend.

references: http://www.nongnu.org/rdiff-backup/ http://live.gnome.org/DejaDup http://duplicity.nongnu.org/

share|improve this answer
    
forgot to mention. if the pc isn't an 'always-on' system, i'd suggest using acron instead of cron for scheduling, as acron will run "past-due" events whereas cron skips them if you boot the system after the scheduled time. –  nathwill Oct 12 '10 at 0:47
    
You can edit your answer as often as you want, feel free to add your new content there, consider comments as "meta" –  Jorge Castro Oct 12 '10 at 0:55
    
thanks for the tip Jorge. new to the site and still getting the hang of the ui... absolutely love the premise of promoting quality answers to the foreground. –  nathwill Oct 12 '10 at 1:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.