I’m trying to create an exclude file, before my backup runs. Using this simple find command produces the correct output, but it fails when used in a systemd
service. I think because of find
escaping.
Is there an alternative to chevron or piping? or a correct way to escape characters? Thanks
error: find[20029]: /usr/bin/find: paths must precede expression:
>’
My service:
[Unit] Description=Restic backup service [Service] Type=oneshot ExecStartPre=/usr/bin/find /home/jake/finished/ -size +1G > /etc/restic/exclude_large.lst ExecStart=/usr/bin/restic backup --verbose --one-file-system --tag systemd.timer $ BACKUP_EXCLUDES $ BACKUP_PATHS ExecStartPost=/usr/bin/restic forget --verbose --tag systemd.timer --group-by "paths,tags" --keep-daily $ RETENTION_DAYS --keep-weekly $ RETENTION_WEEKS --keep-monthly $ RETENTION_MONTHS --keep-yearly $ RETENTION_YEARS EnvironmentFile=/etc/restic/restic-backup.conf