Zululander
New Member
I have tried the following but it does not appear to work.
Created the following script:
And then added a cron job as below using "crontab -e":
But nothing ever happens.
I am not sure if this should work and if it should, how to troubleshoot it.
Created the following script:
Code:
#!/bin/bash
# Get idle time in milliseconds
idle_time=$(xprintidle) #xprintidle has been installed
# Convert idle time to minutes
idle_minutes=$((idle_time / 60000))
# Check if idle time is greater than or equal to 10 minutes
if [ "$idle_minutes" -ge 10 ]; then
shutdown -r
fi
And then added a cron job as below using "crontab -e":
Code:
* * * * * /path/to/idle-reboot.sh #path and file name of idle script
But nothing ever happens.
I am not sure if this should work and if it should, how to troubleshoot it.