Skip to content

Instantly share code, notes, and snippets.

@cmaspi
Created November 4, 2023 06:37
Show Gist options
  • Save cmaspi/791ba3ac5dd17c45ff67e48ddac9b431 to your computer and use it in GitHub Desktop.
Save cmaspi/791ba3ac5dd17c45ff67e48ddac9b431 to your computer and use it in GitHub Desktop.
Auto delete files from mentioned directory after 7 days of inactivity
[Unit]
Description=Delete files in the autodelete directory
[Service]
ExecStart=fish /home/cmaspi/.config/fish/functions/autodelete.fish
[Install]
WantedBy=multi-user.target
[Unit]
Description=Delete files in autodelete every 24 hours
[Timer]
OnUnitActiveSec=1d
Persistent=true
[Install]
WantedBy=timers.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment