Disclaimer: Awecron requires root privileges and written by random guy on the internet. Understand the risks before using it.
IMPORTANT: awecron.sh is no longer maintained and you are DISCOURAGED FROM USING IT because of found SECURITY ISSUES
Recently I found an issue with how it spawns cronjobs for non-root users. Tldr: it can result in privilege escalation. I made a quick patch but I believe it is not sufficient. You are advised NOT TO USE AWECRON until I fully resolve the issue.
I am currently slowly working on a rewrite of awecron in golang, and there this issue will be fixed. This repository will be archived.
Awecron is a small and simple custom cron that has something similar between anacron and crontab. The aim of this project is to create extremely minimal cron that user is supposed to understand and debug on the source code level. Awecron was written without considering user experience and expecting users to fully understand how it works.
- extremely minimal and easy to read
- would still run if misses cronjob run time (if comparing with crontab)
- no complicated time logic (if comparing with anacron and using on desktop)
- bash
- su
- stat
- touch
- GNU coreutils
- BusyBox
- clone the repo
- delete all hidden directories
- configure the cronjob inside of template directory as you wish
- make sure permissions are set securely to prevent privilege escalation
- run main.sh as root like a daemon
bin
is a binary or a shell script that supposed to runtimer
is an essential file that is automatically changed after last run to when the next time thebin
will run- it uses last modification date of the file to set the timer
config
contains configuration variables for the cronjobname
optional name for logsuser
what user runs thebin
intr
interval in seconds
When awecron runs it checks and runs through every directory in the repo. It checks if the current time is more than in timer
file of the selected cronjob, if yes then it will run the bin
and set the timer
again.