Open TheYellowArchitect opened 7 months ago
Cronjob manager is not a part of the default LARBS installation. Cronjob is also optional for Mutt-Wizard.
The command crontab
is used by all cronjob managers such as cronie, anacron, dcron and all others. This is valid for all distros.
If you want the most minimalist and robust solution, you can install dcron. pacman -S dcron
would do the job.
Then you can create cronjobs with it using crontab -e
That command will use your EDITOR and opens a text file for you. You will add cronjobs on each line.
If you are logged in as root user or if you want to automate this in an installation script:
echo "*/30 * * * * $YOUR_SCRIPT" | crontab -u $YOUR_USERNAME -
That above command will create a cronjob for your specified script for your specified user and it will run that every 30 minutes.
For example I use this script for my mail notifications:
The first two lines are for getting the dbus key in order to run notify-send on Wayland as a cronjob. I guess you can delete it on X.
#!/bin/dash
PID=$(pgrep -u $LOGNAME $COMPOSITOR)
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-)
mailsync
NEWMAILS=$(find ~/.local/share/mail/*/*/new -type f)
[ -z "$NEWMAILS" ] && exit
count=$(echo "$NEWMAILS" | wc -l)
notify-send -u critical "You have $count new e-mails."
Installed Artix (runit) then LARBS. There are scripts using
crontab
(e.g./usr/local/bin/mw
for commands likemw -t 10
) butcrontab
outputs:zsh: command not found: crontab
The command
sudo pacman -S crontab
outputs:error: target not found: crontab