Back to Cron Helper
Recipesslsecuritycertbotmaintenance
Auto-Renew Let's Encrypt SSL
Cron job to automatically renew Let's Encrypt SSL certificates.Let's Encrypt certificates expire every 90 days. The Electronic Frontier Foundation (EFF) recommends running the renewal command twice daily. The `--quiet` flag ensures the command only outputs text if an error occurs, keeping your cron logs clean.
Cron Schedule
Command to Run
Copy and paste this command into your crontab or automation script
certbot renew --quietImplementation Examples
Unix/Linux Crontab
# Edit your crontab with: crontab -e
# Add this line to run "Every 12 hours"
0 */12 * * * /path/to/script.sh
Python (with schedule library)
# Using the 'schedule' library
import schedule
import time
def job():
print("Running task: Every 12 hours")
# Note: Python's schedule lib uses natural language,
# but for raw cron execution use 'python-crontab':
# from crontab import CronTab
# cron = CronTab(user='root')
# job = cron.new(command='python job.py')
# job.setall('0 */12 * * *')Node.js (with node-cron)
// Using 'node-cron'
const cron = require('node-cron');
cron.schedule('0 */12 * * *', () => {
console.log('Running task: Every 12 hours');
});Go (with robfig/cron)
// Using 'robfig/cron'
c := cron.New()
c.AddFunc("0 */12 * * *", func() {
fmt.Println("Running task: Every 12 hours")
})
c.Start()GitHub Actions Workflow
# .github/workflows/cron.yml
name: Every 12 hours
on:
schedule:
- cron: '0 */12 * * *'
jobs:
cron:
runs-on: ubuntu-latest
steps:
- run: echo "Running Every 12 hours"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