If you need to create your own cronjob on LoxBerry (to schedule your own scripts).
Using LoxBerry's own schedules
LoxBerry delivers with a hand-full of directories with fixed schedules:
The directory has folders e.g. cron.05min, cron.30min, cron.daily etc. It's script content is called in the appropriate schedule.
To schedule your script with that directories, keep the following in mind:
- The script is not allowed to have a file extension (myscript instead of myscript.sh)
- The script needs to have a correct shebang (e.g.
- The script needs UNIX linebreaks (if you create your script in Windows, use Notepad++ and use the menu item Edit/Format Line Ending/UNIX.
- The script's owner needs to be loxberry (
chown loxberry:loxberry <filename>) and is executed as loxberry. It has no root permissions!
- The script needs execute permission (
chmod +x <filename>).
- Don't name the script as a plugin is called. A plugin may overwrite your script if it uses the same name.
The content of the file is the script, not a cron schedule!
Using own cronjob schedule (allows root execution)
Do not use crontab -e as root to create a cronjob. This job will be lost after a reboot.
Cronjobs on LoxBerry are placed in:
The files are crontab schedules including the user:
# m h dom mon dow user command
00 00 */1 * * loxberry /opt/loxberry/bin/plugins/lbbackup/runbackup.pl type=DDZ scheduled=true > /dev/null 2>&1
MAILTO="" directive, every output of the script is sent by email. On testing, comment out the directive to get messages (possibly error message).
To schedule your script inside cron.d, keep the following in mind:
- As this is a system-wide crontab, in the schedule the user
loxberry must be defined.
- The schedule is not allowed to have a file extension
- The schedule needs UNIX linebreaks (if you create your script in Windows, use Notepad++ and use the menu item Edit/Format Line Ending/UNIX.
- The schedule file owner needs to be root (
chown root:root <filename>) and is executed as root. If your permissions differ, the task is not executed and you may get warning emails.
- The script and the schedule need exactly the following permission:
chmod 755 <filename>). If your permissions differ, the task is not executed and you may get warning emails.
- Don't name the script as a plugin is called. A plugin may overwrite your schedule if it uses the same name.
The content of the file is a crontab schedule, not a script!
Use Google for help on creating crontab files.
Own scripts on LoxBerry
Keep also in mind, that LoxBerry Update will delete all scripts inside the /opt/loxberry directory, that are not part of LoxBerry or it's plugins. Use the legacy folder, or keep your scripts outside of /opt/loxberry.
But cronjobs/scripts in /opt/loxberry/system/cron.xxx are not deleted by LoxBerry Update.
Eigene Webseiten und Scripte am LoxBerry betreiben