I have a script that reminds me to restart my computer if uptime is more than, say 3 days (although its set to 0 days now just to check if the script is running as my computer has been up only over a day..).
I realize it isn't the most elegant script but I am trying! :)
#!/bin/bash up=$(uptime | grep "day" > /home/username/uptime.foo && awk < /home/username/uptime.foo '{ print $3 }') [[ $up -gt 0 ]] && xmessage -center "Restart!" I have made it executable by chmod + x checkup.sh and it works fine when I run it fro the terminal via ./checkup.sh
My crontab entry for this script is:
46 14 * * * /home/username/Desktop/./checkup.sh
So it runs at 14:46hrs daily...
So... I am thinking it should run, unless I didn't something really silly. Also, do you think it's ok to move this bash script to /bin?
/home/dnaneet/Desktop/./checkup.shworks fine. But/home/dnaneet/Desktop/checkup.shmay not work right? Because it needs a./?