Remix.run Logo
dv35z 2 hours ago

I have a cron job which restarts my computer every day (Linux Mint Debian edition). I like waking up to a "fresh" computer, and since I know that it will restart every day - this is a "forcing function" to (1) be diligent about saving things that are important, (2) treating browser tabs, random notes, etc as ephemeral, and bookmarking the important stuff.

I used to work at an office where we pair-programmed with clients all day (Pivotal Labs), and most of our computers had some sort of "automatically restart / restore from a known-good image". I liked this, as it resulted in less cruft over time, and some intentionality about what getting a computer into a productive state means. It also got me thinking of using automatic routines to accomplish goals, and not being so attached to my open tabs, etc. Let it gooo....

To be more specific about this - for those wanting to get into blogging/publishing, this could mean auto-opening the website project folder using VSCodium upon user login, so its ready to go for the morning coffee. More half the time I just close it - but as a "default", it makes it easy for me to do the thing I want to do.

  sudo crontab -e -u root

  #-----------------------------
  # RESTART COMPUTER DAILY
  #-----------------------------
  00 04 * * * /usr/sbin/shutdown -r +5  "Rebooting in 5 minutes. Run 'shutdown -c' to cancel"
artisinal an hour ago | parent [-]

A slightly more fun version:

  0 0 * * * sleep $((RANDOM % 86400)) && /usr/sbin/shutdown -r +5 "Rebooting in 5 minutes. Run 'shutdown -c' to cancel"