| File | Date | Author | Commit |
|---|---|---|---|
| tests | 2024-05-01 |
|
[e29d8d] add rootID check |
| INSTALL | 2018-07-05 |
|
[64ecf5] Add a regression testing script. Contains 20 te... |
| Makefile | 2024-05-01 |
|
[699858] improve Makefile |
| README.md | 2024-12-15 |
|
[8c8951] document how to use optinal "context" parameter |
| vdcron | 2024-12-15 |
|
[5a71db] increment version |
| vdcron.8 | 2024-12-15 |
|
[8c8951] document how to use optinal "context" parameter |
| vdcron.conf.8 | 2024-11-06 |
|
[e94c92] adapt man pages to the remove of HHMM |
| vdcron_root.conf | 2024-12-28 |
|
[09f980] adapt sample vdcron.conf with new command param... |
vdcron is a scheduling utility designed to replace cron for systems that do not run continuously, such as laptops. Unlike traditional cron, vdcron does not assume a machine is always on and instead runs scheduled tasks when triggered by an external event, such as waking up from sleep.
cron.vdcron isnīt a background daemon. Instead, itīs designed to be triggered by external events, such as system resume or user login.Since vdcron does not run continuously, it must be triggered by other means. For example:
- Resume from Sleep: On OpenBSD, trigger vdcron via the apmd resume script:
obsd:~ # cat /etc/apm/resume
#!/bin/sh
/usr/local/bin/vdcron "/etc/apm/resume"
Ensure apmd is enabled:
rcctl enable apmd
rcctl start apmd
vdcron can also be run at startup, on user login, or even periodically with cron using @reboot.-h: Display help information-d: Debug mode for detailed logs-s value: Set an initial sleep time (default: 10 seconds)-f file: Specify an alternative config file (default: /etc/vdcron.conf for root or ~/.vdcron/vdcron.conf for other users)vdcron.conf)vdcron uses a configuration file, /etc/vdcron.conf for root or ~/.vdcron/vdcron.conf for regular users. Each line represents a task with a schedule and command. The format options include:
Date-Based: Run at a specific date or time, with optional repetition. Example:
+20240101 echo "Happy New Year!"
Weekday and Month-Based: Run on specific weekdays or months, with optional intervals. Example:
Monday/7 echo "Weekly Reminder"
April/1 sh /etc/monthly_task
Always: Run every time vdcron is triggered:
Always echo "System is active"
Rescheduling Failed Tasks: Tasks with a + prefix retry on failure, ensuring network or dependency issues do not prevent completion.
+20240101 echo "Happy New Year!"
Sunday sh /etc/weekly_maintenance
Always /usr/local/bin/monitor_script
+20240101/1 sh /etc/daily_task
Output and errors are logged to /var/log/vdcron.log for root or ~/.vdcron/vdcron.log for other users. Logging can be suppressed with the -q option in the configuration file.
Developed by Vincent Delft. Contact: vincent.delft@gmail.com
Tested on OpenBSD 6.3+ and on debian.