workshops:byo_scripts
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
workshops:byo_scripts [2010/08/01 14:09] – rmoonen | workshops:byo_scripts [2010/08/01 22:39] – rmoonen | ||
---|---|---|---|
Line 54: | Line 54: | ||
scp -B / | scp -B / | ||
rm -rf / | rm -rf / | ||
+ | exit 0 | ||
</ | </ | ||
+ | And here is the script to delete old backups: | ||
+ | |||
+ | < | ||
+ | #!/bin/bash | ||
+ | COUNT=0 | ||
+ | for file in `ls -c / | ||
+ | do | ||
+ | COUNT=`expr $COUNT + 1` | ||
+ | # If we have 8 backups, delete the last, so we only keep a weeks worth, deleting the oldest | ||
+ | if [ 0$COUNT -eq 8 ] | ||
+ | then | ||
+ | rm / | ||
+ | COUNT=`expr $COUNT - 1` | ||
+ | fi | ||
+ | done | ||
+ | exit 0 | ||
+ | </ | ||
+ | |||
+ | Run this script on your webserver. |
workshops/byo_scripts.txt · Last modified: 2017/10/12 21:58 by 127.0.0.1