Last active
March 18, 2017 15:00
-
-
Save pscheid92/c81d3ca0edc0a0c73ec6a3209ed20f7f to your computer and use it in GitHub Desktop.
systemd timer to clean your trash daily
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Removes files older than 7 days from trash | |
[Service] | |
Type=oneshot | |
ExecStart=/home/dummy_user/.bin/empty_trash.sh | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rm -r $HOME/.local/share/expunged/* | |
rm -r $HOME/.local/share/files/* | |
rm -r $HOME/.local/share/info/* | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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