crontab-ui
crontab-ui copied to clipboard
dockerized crontab-ui jobs will not run without trick
Before all thank you for your amazing project!
I'm using this cool tool on docker. My docker-compose.yml
is shown below:
version: '3.7'
services:
crontab-ui:
container_name: crontab-ui
build: .
image: alseambusher/crontab-ui
network_mode: bridge
ports:
- 3030:8000
env_file: variables.env
volumes:
# - /var/spool/cron/crontabs/my_username_here:/etc/crontabs/root
- /etc/cron.d:/etc/crontabs
- ./data/crontabs:/crontab-ui/crontabs
As you already know **If we are decided to add a cronjob to cron.d, we have to mention the username, after time configuration.
So, this will work for crontab -e
:
* * * * * wall Hello from crontabs $(date)
But it will definitely not work in cron.d
and it should be:
* * * * * wall my_username_here Hello from cron.d $(date)
As you can see in the image below, I used the last time text box to define my username! Can we add an input for that? (I'll be honored to volunteer this task, if you let me know your idea about it.)
Cheers
Crontab-UI home page (Please kindly pay attention to time column):
Result on my host machine:
Hey @tayyebi I don't completely understand your problem, but why wouldn't you add your username as a part of the "Command" field?
Unrelated to your issue, but you probably understand this better than I do:
- Does crontab-ui installed with docker work properly (meaning that it can read and write to the real crontab file and see execution log) only if the crontabs folder is mounted?
- Does it update the crontab file only if "save to crontab" is pressed?
Dear @icemtel it's working like a charm!
but why wouldn't you add your username as a part of the "Command" field?
Because if add add the username in command
field, the saved file will contain ((({ username_here
which will not work!
Does it update the crontab file only if "save to crontab" is pressed?
Short answer: YES.
As I wanted to use this container to configure cronjobs on my host machine, I linked /etc/cron.d:/etc/crontabs
in my docker-compose.yml
.
If I want to summarize, it will be so nice, if we could have another field, right after cron expression (and before ((({
), for username.
Cheers.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
hey @tayyebi i have the same problem.. i followed your workaround, but still not working.. did you find the solution?
i got
(*system*root) RELOAD (/etc/cron.d/root)
Error: bad username; while reading /etc/cron.d/root
(*system*root) ERROR (Syntax error, this crontab file will be ignored)
in /var/log/syslog
nevermind.. it works, it didn't because one of the cron did not use this trick, so the whole file was ignored..
If I want to summarize, it will be so nice, if we could have another field, right after cron expression (and before ((({), for username.
agree, i hope it is on the roadmap..
thanks..