User Tools

Site Tools


workshops:byo_scripts

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
workshops:byo_scripts [2010/08/01 14:09] rmoonenworkshops:byo_scripts [2010/08/01 22:39] rmoonen
Line 54: Line 54:
 scp -B /tmp/backup$enum.tgz robert@ares:/var/www/ares/mint scp -B /tmp/backup$enum.tgz robert@ares:/var/www/ares/mint
 rm -rf /tmp/backup$enum.tgz rm -rf /tmp/backup$enum.tgz
 +exit 0
 </code> </code>
  
 +And here is the script to delete old backups:
 +
 +<code>
 +#!/bin/bash
 +COUNT=0
 +for file in `ls -c /var/www/ares/mint`
 +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 /var/www/ares/mint/$file
 +    COUNT=`expr $COUNT - 1`
 +  fi
 +done
 +exit 0
 +</code>
 +
 +Run this script on your webserver.
workshops/byo_scripts.txt · Last modified: 2017/10/12 21:58 by 127.0.0.1