Anacron Job Generator (Daily/Weekly/Monthly)
Generate anacron job configurations for daily, weekly, and monthly tasks. Create reliable scheduled jobs that run even when the system is offline, with support for both anacron and systemd timer alternatives.
Add New Anacron Job
How to Use
1. Install Anacron
Most Linux distributions include anacron by default. If not:
sudo apt-get install anacron # Ubuntu/Debian
sudo yum install anacron # CentOS/RHEL
2. Configure Anacron
Copy the generated anacrontab to:
/etc/anacrontab
3. Start Anacron Service
sudo systemctl enable anacron
sudo systemctl start anacron
4. Alternative: Use Systemd Timers
For modern systems, you can use the generated systemd timer files instead of anacron.
What is Anacron?
Anacron is a Linux utility that runs commands at specified intervals, regardless of when the system was last running. Unlike cron, which requires the system to be running at the exact time specified, anacron ensures that missed jobs are executed when the system comes back online.
Key Benefits:
- Runs missed jobs when the system is back online
- Perfect for laptops and systems that aren't always running
- Simple configuration format
- Built-in delay mechanism to prevent system overload
Anacrontab Format
The anacrontab file uses a simple format with four fields separated by tabs or spaces:
period delay job-identifier command
Common Use Cases
Daily Tasks
- • System backups
- • Log rotation
- • Security updates
- • Disk cleanup
Weekly Tasks
- • Full system backup
- • Package updates
- • Performance monitoring
- • Security scans
Monthly Tasks
- • System maintenance
- • Archive old logs
- • Update documentation
- • Performance reports
System Administration
- • User management
- • Disk space monitoring
- • Service health checks
- • Configuration backups
Best Practices
1. Use Descriptive Identifiers
Choose clear, descriptive names for your jobs that indicate their purpose and frequency.
2. Set Appropriate Delays
Use delays to prevent multiple jobs from running simultaneously and overwhelming the system.
3. Test Commands First
Always test your commands manually before adding them to anacron to ensure they work correctly.
4. Use Absolute Paths
Use absolute paths for commands and scripts to avoid path-related issues.
5. Monitor Job Execution
Check anacron logs regularly to ensure jobs are executing as expected.
Troubleshooting
Common Issues
Useful Commands
sudo systemctl status anacron
- Check anacron service statussudo journalctl -u anacron
- View anacron logssudo anacron -T
- Test anacron configurationsudo anacron -f
- Force execution of all jobsRelated Tools
Crontab Entry Visualizer
Visualize cron expressions with interactive diagrams
Try Crontab Visualizer →Stay Updated with Linux Tools
Get notified about new tools, updates, and Linux administration tips.