Back to Cron Helper
Recipelinuxmaintenancesystemmemory
Clear Linux Page Cache Weekly
Cron job to clear Linux RAM cache every week for maintenance.This command forces the Linux kernel to drop clean caches (PageCache), dentries, and inodes from memory. While Linux manages RAM efficiently, this manual intervention can be useful on memory-constrained servers to free up RAM for applications.
Cron Schedule
Command to Run
Copy and paste this command into your crontab or automation script
sync; echo 1 > /proc/sys/vm/drop_cachesImplementation 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