Skip to content

Instantly share code, notes, and snippets.

@patrickkeller
Created May 19, 2013 14:30
Show Gist options
  • Save patrickkeller/5607822 to your computer and use it in GitHub Desktop.
Save patrickkeller/5607822 to your computer and use it in GitHub Desktop.
Copy MongoDB backup every two weeks to a seperate folder
#!bin/sh
day_of_week="$(date +'%A')"
week_of_year="$(date +'%W_%Y')"
backup_dest_daily="/home/apbackup/web4fm/${day_of_week}"
backup_dest="/home/apbackup/web4fm/${week_of_year}"
# create weekly folder
mkdir $backup_dest
# copy the file of today to weekly folder
cp $backup_dest $backup_dest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment