diff --git a/nixos/hosts/backups-rpi4/backup-script.nix b/nixos/hosts/backups-rpi4/backup-script.nix index 319e78f0..4b83448d 100644 --- a/nixos/hosts/backups-rpi4/backup-script.nix +++ b/nixos/hosts/backups-rpi4/backup-script.nix @@ -92,30 +92,30 @@ fi /bin/echo -e "${LGREEN}rsync -avr --delete /Storage/Video/Movies/ /mnt/$drive2/Movies/${RESTORE}" /usr/bin/rsync -avr --delete root@nuc-docker01:/Storage/Video/Movies/ /mnt/$drive2/Movies/ - /bin/echo -e "${PURPLE}================================================================================${RESTORE}" - /bin/echo -e "${RED}======= Time: `date`${RESTORE}" - /bin/echo -e "${LGREEN}rsync -avr --delete /Storage/Video/TV_Shows/[0-9]* /mnt/$drive1/TV_Shows/${RESTORE}" - /usr/bin/rsync -avr --delete root@nuc-docker01:/Storage/Video/TV_Shows/[0-9]* /mnt/$drive1/TV_Shows/ +/bin/echo -e "${PURPLE}================================================================================${RESTORE}" +/bin/echo -e "${RED}======= Time: `date`${RESTORE}" +/bin/echo -e "${LGREEN}rsync -avr --delete /Storage/Video/TV_Shows/[0-9]* /mnt/$drive1/TV_Shows/${RESTORE}" +/usr/bin/rsync -avr --delete root@nuc-docker01:/Storage/Video/TV_Shows/[0-9]* /mnt/$drive1/TV_Shows/ - /bin/echo -e "${PURPLE}================================================================================${RESTORE}" - /bin/echo -e "${RED}======= Time: `date`${RESTORE}" - /bin/echo -e "${LGREEN}rsync -avr --delete /Storage/Video/TV_Shows/[A-K]* /mnt/$drive1/TV_Shows/${RESTORE}" - /usr/bin/rsync -avr --delete root@nuc-docker01:/Storage/Video/TV_Shows/[A-E]* /mnt/$drive1/TV_Shows/ +/bin/echo -e "${PURPLE}================================================================================${RESTORE}" +/bin/echo -e "${RED}======= Time: `date`${RESTORE}" +/bin/echo -e "${LGREEN}rsync -avr --delete /Storage/Video/TV_Shows/[A-K]* /mnt/$drive1/TV_Shows/${RESTORE}" +/usr/bin/rsync -avr --delete root@nuc-docker01:/Storage/Video/TV_Shows/[A-E]* /mnt/$drive1/TV_Shows/ - /bin/echo -e "${PURPLE}================================================================================${RESTORE}" - /bin/echo -e "${RED}======= Time: `date`${RESTORE}" - /bin/echo -e "${LGREEN}rsync -avr --delete /Storage/Video/TV_Shows/[L-M]* /mnt/$drive2/TV_Shows/${RESTORE}" - /usr/bin/rsync -avr --delete root@nuc-docker01:/Storage/Video/TV_Shows/[F-M]* /mnt/$drive2/TV_Shows/ +/bin/echo -e "${PURPLE}================================================================================${RESTORE}" +/bin/echo -e "${RED}======= Time: `date`${RESTORE}" +/bin/echo -e "${LGREEN}rsync -avr --delete /Storage/Video/TV_Shows/[L-M]* /mnt/$drive2/TV_Shows/${RESTORE}" +/usr/bin/rsync -avr --delete root@nuc-docker01:/Storage/Video/TV_Shows/[F-M]* /mnt/$drive2/TV_Shows/ - /bin/echo -e "${PURPLE}================================================================================${RESTORE}" - /bin/echo -e "${RED}======= Time: `date`${RESTORE}" - /bin/echo -e "${LGREEN}rsync -avr --delete /Storage/Video/TV_Shows/[N-Z]* /mnt/$drive3/TV_Shows/${RESTORE}" - /usr/bin/rsync -avr --delete root@nuc-docker01:/Storage/Video/TV_Shows/[N-Z]* /mnt/$drive3/TV_Shows/ +/bin/echo -e "${PURPLE}================================================================================${RESTORE}" +/bin/echo -e "${RED}======= Time: `date`${RESTORE}" +/bin/echo -e "${LGREEN}rsync -avr --delete /Storage/Video/TV_Shows/[N-Z]* /mnt/$drive3/TV_Shows/${RESTORE}" +/usr/bin/rsync -avr --delete root@nuc-docker01:/Storage/Video/TV_Shows/[N-Z]* /mnt/$drive3/TV_Shows/ - /bin/echo -e "${PURPLE}================================================================================${RESTORE}" - /bin/echo -e "${RED}======= Time: `date`${RESTORE}" - /bin/echo -e "${LGREEN}rsync -avr --delete /Storage/Video/YouTube /mnt/$drive3/YouTube/${RESTORE}" - /usr/bin/rsync -avr --delete root@nuc-docker01:/Storage/Video/YouTube/ /mnt/$drive3/YouTube/ +/bin/echo -e "${PURPLE}================================================================================${RESTORE}" +/bin/echo -e "${RED}======= Time: `date`${RESTORE}" +/bin/echo -e "${LGREEN}rsync -avr --delete /Storage/Video/YouTube /mnt/$drive3/YouTube/${RESTORE}" +/usr/bin/rsync -avr --delete root@nuc-docker01:/Storage/Video/YouTube/ /mnt/$drive3/YouTube/ /bin/echo -e "${PURPLE}================================================================================${RESTORE}" /bin/echo -e "${RED}======= Time: `date`${RESTORE}" diff --git a/nixos/hosts/backups-rpi4/cron.nix b/nixos/hosts/backups-rpi4/cron.nix new file mode 100644 index 00000000..dfa2d4ee --- /dev/null +++ b/nixos/hosts/backups-rpi4/cron.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: { + services.cron = { + enable = true; + systemCronJobs = [ + # Backups from nuc-docker01 - See "backup-script.nix" + # https://git.sysctl.io/albert/random-scripts/src/branch/master/rsync-pi/rsync-all.sh + ''0 0 * * * root rsync-backup'' + ]; + }; +} \ No newline at end of file