diff --git a/host/cloud/modules/cron/default.nix b/host/cloud/modules/cron/default.nix index 5509bf0..327e2da 100644 --- a/host/cloud/modules/cron/default.nix +++ b/host/cloud/modules/cron/default.nix @@ -1,11 +1,13 @@ { - services.cron = { - enable = true; - systemCronJobs = [ - # Runs snapraid-runner every day at 3am - "0 3 * * * root snapraid-runner" - # Runs a backup of the Docker storage directory every Monday at 4am - "0 4 * * 0 root tar -Pzcf /pool/Backups/DockerStorage/DockerStorage.tar.gz -C /mnt/drive1/DockerStorage ." - ]; - }; -} \ No newline at end of file + services.cron = { + enable = true; + systemCronJobs = [ + # Runs snapraid-runner every day at 3am + "0 3 * * * root snapraid-runner" + # Runs a backup of the Docker storage directory every Monday at 4am + "0 4 * * 0 root tar -Pzcf /pool/Backups/DockerStorage/DockerStorage.tar.gz -C /mnt/drive1/DockerStorage ." + # Runs a backup of the forgejo directory every 2 days at 4am + "0 4 */2 * * root tar -Pzcf /pool/Backups/forgejo/forgejo.tar.gz -C /pool/forgejo ." + ]; + }; +} diff --git a/host/cloud/modules/logrotate/logrotate.conf b/host/cloud/modules/logrotate/logrotate.conf index b244a89..1957fe9 100644 --- a/host/cloud/modules/logrotate/logrotate.conf +++ b/host/cloud/modules/logrotate/logrotate.conf @@ -8,4 +8,11 @@ rotate 4 rotate 8 nocompress su root root +} + +"/pool/Backups/forgejo/forgejo.tar.gz" { + daily + rotate 20 + nocompress + su root root } \ No newline at end of file