Skip to content

Instantly share code, notes, and snippets.

@pscheid92
Last active March 18, 2017 15:00
Show Gist options
  • Save pscheid92/c81d3ca0edc0a0c73ec6a3209ed20f7f to your computer and use it in GitHub Desktop.
Save pscheid92/c81d3ca0edc0a0c73ec6a3209ed20f7f to your computer and use it in GitHub Desktop.
systemd timer to clean your trash daily
[Unit]
Description=Removes files older than 7 days from trash
[Service]
Type=oneshot
ExecStart=/home/dummy_user/.bin/empty_trash.sh
#!/bin/bash
rm -r $HOME/.local/share/expunged/*
rm -r $HOME/.local/share/files/*
rm -r $HOME/.local/share/info/*
[Unit]
Description=Runs trash cleaning once every day
[Timer]
OnCalendar=daily
Persistent=true
[Install]
WantedBy=timers.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment