Skip to content

Instantly share code, notes, and snippets.

@BrianAker
Created January 6, 2023 23:30
Show Gist options
  • Select an option

  • Save BrianAker/d31d844320d9db6530ff4f66fd89a876 to your computer and use it in GitHub Desktop.

Select an option

Save BrianAker/d31d844320d9db6530ff4f66fd89a876 to your computer and use it in GitHub Desktop.
#!/bin/sh
FILENAME="`hostname -s`-`cut -d' ' -f1 /etc/version`-`date +%Y%m%d`.db"
#echo $FILENAME
cp /data/freenas-v1.db /mnt/data/truenas/$FILENAME
echo "Backup $FILENAME created"
find /mnt/data/truenas/NAS-?-TrueNAS-*.db -mtime +365 -exec rm {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment