Skip to content

Instantly share code, notes, and snippets.

@neolao
Created January 5, 2011 18:02
Show Gist options
  • Save neolao/766698 to your computer and use it in GitHub Desktop.
Save neolao/766698 to your computer and use it in GitHub Desktop.
#!/bin/bash
snapshotDir=/path/to/backup/dir
if [ -d $snapshotDir/daily.2 ]
then
rm -rf $snapshotDir/daily.2
fi
if [ -d $snapshotDir/daily.1 ]
then
mv $snapshotDir/daily.1 $snapshotDir/daily.2
fi
if [ -d $snapshotDir/daily.0 ]
then
mv $snapshotDir/daily.0 $snapshotDir/daily.1
fi
if [ -d $snapshotDir/hourly.0 ]
then
cp -al $snapshotDir/hourly.0 $snapshotDir/daily.0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment