added custome cron scripts
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
LOG_FILE="/var/log/update_reboot.log"
|
||||
REBOOT_FILE="/var/log/reboots.log"
|
||||
|
||||
exec >> "$LOG_FILE" 2>&1
|
||||
|
||||
echo "Script started at: $(date)"
|
||||
|
||||
sudo apt-get update && sudo apt-get upgrade -y
|
||||
|
||||
if [ -f /var/run/reboot-required ]; then
|
||||
echo "Rebooting at: $(date)"
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
echo "Rebooted at: $(date)" >> "$REBOOT_FILE"
|
||||
sudo reboot now
|
||||
fi
|
||||
|
||||
echo "No reboot required, script ended at: $(date)"
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
Reference in New Issue
Block a user