CrossEye
Cadet
- Joined
- Oct 23, 2013
- Messages
- 5
I love the fact that there are multiple ways to skin this cat. Personally I like being able to log into the WebGUI and viewing the Tasks / Cron Jobs and seeing the contents of all the scripts running on that NAS vs calling a script from the Cron Jobs and not being able to see the contents of that script from the WebGUI.
So for those that would like a script that can run inside the WebGUI and with a retention window (currently 90 days),
Outputting: config-hostname.internal.domain.com-9.10.1_d989edd-201608250252.db
So for those that would like a script that can run inside the WebGUI and with a retention window (currently 90 days),
Code:
cp /data/freenas-v1.db /mnt/volume/backups/config-`hostname`-`cat /etc/version | awk -F'[- ()]' '{print $2 "_" $4}'`-`date "+%Y%m%d%H%M"`.db && find /mnt/volume/backups/* -mtime +90 -type f -delete
Outputting: config-hostname.internal.domain.com-9.10.1_d989edd-201608250252.db