1

How do we execute a command such as it executes everytime one logs out or shutdowns or restarts the machine ?

To be more specific, I want the autotrash to be executed at logout, or shutdown or restart.

maan81
  • 605
  • 1
  • 6
  • 22
  • 5
    Look at this question http://askubuntu.com/questions/293312/execute-a-script-upon-logout-reboot-shutdown-in-ubuntu – Eric Power Aug 17 '15 at 03:04
  • @EricPower Yes, this is a duplicate. – fosslinux Aug 17 '15 at 04:04
  • @EricPower Thank you for the link. Though it will work. is there a way in using cron ? Like without having to use `sudo`, and without affecting other users ? – maan81 Aug 17 '15 at 08:51
  • @maan81: unfortunately cron knows only about time, not about startup/shutdown. See [crontab(5)](http://manpages.ubuntu.com/manpages/vivid/en/man5/crontab.5.html) for the details. – Andrea Corbellini Aug 17 '15 at 16:29

0 Answers0