diff --git a/nixos/hosts/nuc-server/cron.nix b/nixos/hosts/nuc-server/cron.nix index 65d4f8b6..6e8afc05 100644 --- a/nixos/hosts/nuc-server/cron.nix +++ b/nixos/hosts/nuc-server/cron.nix @@ -1,60 +1,18 @@ { ... }: { - services.cron = { - enable = true; - systemCronJobs = [ - # Back up Local-Storage to NFS Storage - "0 9 * * * root rsync -avr /Local-Storage/Data/Docker/ifargle.com/vpn-stack/ /Storage/Data/Docker/ifargle.com/vpn-stack/" - "0 8 * * * root rsync -avr /Local-Storage/Data/Docker/ifargle.com/dsm-kmip/ /Storage/Data/Docker/ifargle.com/dsm-kmip/" - "0 7 * * * root rsync -avr /Local-Storage/Data/Docker/ifargle.com/dsm-kmip-backup/ /Storage/Data/Docker/ifargle.com/dsm-kmip-backup/" - "* * * * * root rsync -avr /Storage/Data/docker-compose/ /Local-Storage/Data/docker-compose/" - # Back up running containers weekly - "0 0 * * * root rm -rf /Storage/Backups/Docker/ifargle.com/*; for i in $(docker ps --format '{{.Names}}'); do docker export $i | gzip -cf | cat > /Storage/Backups/Docker/ifargle.com/$i.tar.gz; done" - # Restart the VPN stack - "0 0 * * * root /Storage/Data/docker-compose/ifargle.com/scripts/restart-vpn.sh" - ]; - }; - -# Old crontab: -# @reboot /usr/bin/mount -a -# @reboot /usr/sbin/modprobe ip_tables -# -# # Sync /Local-Storage/ to /Storage/ -# 0 9 * * * /usr/bin/rsync -avr /Local-Storage/Data/Docker/ifargle.com/vpn-stack/ /Storage/Data/Docker/ifargle.com/vpn-stack/ -# -# # Sync sysctl.io's docker home: -# # 0 7 * * * /usr/bin/rsync -avr --delete albert@framework-server:/Storage/Data/Docker/ /Storage/Data/Docker/ - -# # Sync sysctl.io's nextcloud container InstantUpload directory -# # 0 5 * * * /usr/bin/rsync -avr albert@framework-server:/Storage/Data/Docker/nextcloud/html/data/albert/files/InstantUpload/ /Storage/Video/Pictures/InstantUpload/ -# # 0 5 * * * /usr/bin/rsync -avr albert@framework-server:/Storage/Data/Docker/nextcloud/html/data/albert/files/Wallpapers/ /Storage/Video/Pictures/Wallpapers - -# # Restart VPN Stack -# 0 0 * * * /Storage/Data/docker-compose/ifargle.com/scripts/restart-vpn.sh - -# # /usr/bin/reposync currently used repos -# # RHEL / Rocky 8 -# @daily /usr/bin/reposync -p /Storage/Data/Software/Repositories/RockyLinux/8/appstream --download-metadata --repo=appstream -# @daily /usr/bin/reposync -p /Storage/Data/Software/Repositories/RockyLinux/8/baseos --download-metadata --repo=baseos -# @daily /usr/bin/reposync -p /Storage/Data/Software/Repositories/RockyLinux/8/docker-ce-stable --download-metadata --repo=docker-ce-stable -# @daily /usr/bin/reposync -p /Storage/Data/Software/Repositories/RockyLinux/8/epel --download-metadata --repo=epel -# @daily /usr/bin/reposync -p /Storage/Data/Software/Repositories/RockyLinux/8/extras --download-metadata --repo=extras -# @daily /usr/bin/reposync -p /Storage/Data/Software/Repositories/RockyLinux/8/powertools --download-metadata --repo=powertools -# @daily /usr/bin/reposync -p /Storage/Data/Software/Repositories/RockyLinux/8/rpmfusion-free-updates --download-metadata --repo=rpmfusion-free-updates -# @daily /usr/bin/reposync -p /Storage/Data/Software/Repositories/RockyLinux/8/tailscale-stable --download-metadata --repo=tailscale-stable -# # RHEL / Rocky 9 -# @daily /usr/bin/reposync -p /Storage/Data/Software/Repositories/RockyLinux/9/appstream --download-metadata --repo=appstream --releasever=9 -# @daily /usr/bin/reposync -p /Storage/Data/Software/Repositories/RockyLinux/9/baseos --download-metadata --repo=baseos --releasever=9 -# @daily /usr/bin/reposync -p /Storage/Data/Software/Repositories/RockyLinux/9/docker-ce-stable --download-metadata --repo=docker-ce-stable --releasever=9 -# @daily /usr/bin/reposync -p /Storage/Data/Software/Repositories/RockyLinux/9/epel --download-metadata --repo=epel --releasever=9 -# @daily /usr/bin/reposync -p /Storage/Data/Software/Repositories/RockyLinux/9/extras --download-metadata --repo=extras --releasever=9 -# @daily /usr/bin/reposync -p /Storage/Data/Software/Repositories/RockyLinux/9/powertools --download-metadata --repo=powertools --releasever=9 -# @daily /usr/bin/reposync -p /Storage/Data/Software/Repositories/RockyLinux/9/rpmfusion-free-updates --download-metadata --repo=rpmfusion-free-updates --releasever=9 -# @daily /usr/bin/reposync -p /Storage/Data/Software/Repositories/RockyLinux/9/tailscale-stable --download-metadata --repo=tailscale-stable --releasever=9 -# -# -# # Back up the running containers weekly -# @weekly source ~/.bashrc; rm -rf /Storage/Backups/Docker/ifargle.com/*; for i in $(docker ps --format '{{.Names}}'); do docker export $i | gzip -cf | cat > /Storage/Backups/Docker/ifargle.com/$i.tar.gz; done -# -# # back up crontab: -# 0 0 * * * /usr/bin/crontab -l > /Storage/Data/Temporary/crontab + services.cron = { + enable = true; + systemCronJobs = [ + # Back up Local-Storage to NFS Storage + "0 9 * * * root rsync -avr --delete /Local-Storage/Data/Docker/ifargle.com/vpn-stack/ /Storage/Data/Docker/ifargle.com/vpn-stack/" + "0 8 * * * root rsync -avr --delete /Local-Storage/Data/Docker/ifargle.com/dsm-kmip/ /Storage/Data/Docker/ifargle.com/dsm-kmip/" + "0 7 * * * root rsync -avr --delete /Local-Storage/Data/Docker/ifargle.com/dsm-kmip-backup/ /Storage/Data/Docker/ifargle.com/dsm-kmip-backup/" + "* * * * * root rsync -avr --delete /Storage/Data/docker-compose/ /Local-Storage/Data/docker-compose/" + # Back up running containers weekly + "0 0 * * * root rm -rf /Storage/Backups/Docker/ifargle.com/*; for i in $(docker ps --format '{{.Names}}'); do docker export $i | gzip -cf | cat > /Storage/Backups/Docker/ifargle.com/$i.tar.gz; done" + # Restart the VPN stack + "0 0 * * * root /Storage/Data/docker-compose/ifargle.com/scripts/restart-vpn.sh" + # Set up a RAW Photo Archive + "0 0 * * * root rsync -avr /Storage/Media/Pictures/RAW/ /Storage/Media/Pictures/RAW_Archive/" + ]; + }; }