Back to Cron Helper
Recipelinuxsecurityupdatesubuntu
Auto-Update System Packages
Weekly cron job to update Linux system packages.Keeping your server packages up to date is critical for security. This command updates the package lists and installs available upgrades. The `-y` flag automatically answers "yes" to prompts. Note: Be careful using this on critical production servers without testing.
Cron Schedule
Command to Run
Copy and paste this command into your crontab or automation script
apt-get update && apt-get upgrade -yImplementation Examples
Unix/Linux Crontab
0 0 * * 1 /path/to/script.sh
Python (with schedule library)
schedule.every().monday.do(job)
Node.js (with node-cron)
cron.schedule('0 0 * * 1', () => {
console.log('Running every Monday');
});Go (with robfig/cron)
c.AddFunc("0 0 * * 1", func() { fmt.Println("Run every Monday") })GitHub Actions Workflow
- cron: "0 0 * * 1"
Related Cron Recipes
Automate PostgreSQL Backups Daily
databasepostgresbackup
Automate MySQL Backups Daily
databasemysqlbackup
Automate MongoDB Backups Daily
databasemongodbbackup
Automate Redis RDB Snapshots
databaserediscache
PostgreSQL Vacuum Analyze
databasepostgresmaintenance