Skip to main content

Auto upgrade Proxmox VE (Script)

🚀 One-Line Download & Execute:

clear && curl -fsSL https://docs.greenhome.stream/attachments/40 -o auto-upgrade-proxmox.sh && chmod +x auto-upgrade-proxmox.sh && clear && ./auto-upgrade-proxmox.sh

Here’s a clear step-by-step guide explaining what the auto-upgrade-proxmox.sh script does, and how you can set up cron jobs to:

  • Run it daily at 03:00
  • Run it weekly on Sundays at 04:00, and reboot the system if the script completes successfully.

🧠 Script Purpose: What Does auto-upgrade-proxmox.sh Do?

This script is designed to automatically update your Proxmox system using apt.


⏰ How to Add Cron Jobs

To schedule this script, you need to edit the system crontab or the root user's crontab.

⚠️ Updates and reboots require root permissions, so make sure the script is owned by root and executable.

🧷 Make Script Executable

sudo chmod +x /path/to/auto-upgrade-proxmox.sh

📆 Add Cron Jobs

Edit the root crontab:

sudo crontab -e

Add the following lines at the bottom:

# Daily at 03:00 – Run update only
0 3 * * * /path/to/auto-upgrade-proxmox.sh >> /var/log/auto-upgrade.log 2>&1

# Weekly on Sunday at 04:00 – Run update and reboot if successful
0 4 * * 0 /path/to/auto-upgrade-proxmox.sh && /sbin/reboot

🔄 Explanation of Cron Syntax

Field Meaning
0 3 * * * Every day at 03:00 AM
0 4 * * 0 Every Sunday at 04:00 AM
&& /sbin/reboot Only reboot if the script exits with success (code 0)

✅ Summary

Task Schedule Action
Run update script daily 03:00 every day Just updates and notifies
Weekly update + reboot 04:00 Sundays Updates, notifies, and reboots on success

✅ Optional: Logging Output

You can monitor the script’s output in /var/log/auto-upgrade.log.

To ensure logs don’t grow indefinitely, consider adding log rotation or using logrotate.


Ins0mniA