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
period:daily, weekly, or monthly
delay:delay in minutes before executing the job
identifier:unique name for the job
command:the command or script to execute

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

Jobs not running: Check if anacron service is enabled and running
Permission denied: Ensure commands have proper execute permissions
Path not found: Use absolute paths for all commands
Jobs running multiple times: Check for duplicate entries in anacrontab

Useful Commands

sudo systemctl status anacron- Check anacron service status
sudo journalctl -u anacron- View anacron logs
sudo anacron -T- Test anacron configuration
sudo anacron -f- Force execution of all jobs

Related Tools

Crontab Generator

Generate cron expressions for scheduled tasks

Try Crontab Generator →

Crontab Validator

Validate cron expressions and check syntax

Try Crontab Validator →

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.