What the Hell? I need to back up !!

Ok, I’m currently in a shiit, I’m having to backup my stuffs on my servers and this I need to do it quite frequently. So the issue is:

-Automatically backup frequently(check cron jobs if you want to know)

-Naming Convention to timestamp the folder

So, how do I recognise when a file has been copied? We timestamp the folder using a naming convention say dd.mm.yy.hh.mm.ss(day.month.year.hour.minute.second). We use scp to copy the folder to my server, ensure that your public and private keys are setup so that you can automate it. The key here is the naming convention.

scp -r /path/to/folder server@username.com:/path/to/folder/$(date +\%d.\%m.\%y.\%H.\%M.\%S)

Ok, if you really want to automate the whole stuff:

  • Set up your keys to ensure that authorization can be automated
  • Its good to create an alias of the command so that you have a shortcut whenever you want to do it manually
  • create a crontab and add the frequency

Speak Your Mind

*