Information Technology Grimoire

Version .0.0.1

IT Notes from various projects because I forget, and hopefully they help you too.

old file backup

echo $FWDIR
/opt/CPsuite-R71/fw1
!#/bin/bash
VERSION=/opt/CPsuite-R71/fw1
# If you want to script the SCP'ing of old files:
find $VERSION/log/*.* -type f -mtime +30 -exec scp {} admin@192.168.1.2:/home/admin/ \;
# And if you want to delete the files after you SCP them, there are two methods:
find $VERSION/log/*.* -type f -mtime +30 | while read i; do rm "$i"; done