alseambusher / crontab-ui

Easy and safe way to manage your crontab file
https://lifepluslinux.blogspot.com/2015/06/crontab-ui-easy-and-safe-way-to-manage.html
MIT License
2.88k stars 478 forks source link

Logs are written to wrong location (/etc/crontabs instead of /crontab-ui/crontabs/logs) #211

Closed outfoxer closed 1 year ago

outfoxer commented 2 years ago

Hi! Thanks for the amazing app!

I'm running alseambusher/crontab-ui:0.3.16 in Docker.

Everything works fine, except the location of the logs. Logs are written to wrong location — /etc/crontabs instead of /crontab-ui/crontabs/logs. Setting CRON_DB_PATH to /crontab-ui/crontabs doesn't work either.

image

Is this a bug or misconfiguration? Thanks!

rodriciru commented 1 year ago

Hi. I have the same issue, but I fixed Maybe you have mounted crontqb dir as an host dir? If yes, in my case you have to manually create the logs folder, and then everything will be fine. Node cant create the dir for us apparently

Also the Cron logs is always created at /etc/crontab path and then is copied to /crontab-ui folder You can se the actual Cron job by doing cronjob -l and see the code of the cron

stale[bot] commented 1 year ago

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.

LostOnTheLine commented 1 year ago

you have to manually create the logs folder, and then everything will be fine. Node cant create the dir for us apparently

Also the Cron logs is always created at /etc/crontab path and then is copied to /crontab-ui folder You can se the actual Cron job by doing cronjob -l and see the code of the cron

So I mounted the folder /crontab-ui/crontabs/logs but my logs are not in there. When not a mounted directory that directory already existed but not persistent but it only had one file in it README.md

This folder will have all the log files

The container had been running for over 2 days & had completed many jobs but nothing was ever moved into that folder except the ironic README file. Mounting it changed nothing.

I am running a custom image based on this one, as I use it to run cron jobs itself as opposed to managing ones for the host system & I have added needed dependencies to run those jobs, like python3, pip, Perl & others, but no changes I have made should be related to this. Can you confirm that you are actually getting logs in the /crontab-ui/crontabs/logs folder? If so could you share your setup?

This seems like a minor problem as anything in etc/crontabsis going to be checked by the system but since there's no chance there will be a user with the name of the file it's just a few wasted clock cycles. My bigger concern is that the I want to access these logs, livetail access, & to do that I need to expose the crontabs directory to whatever is going to access them which is a security risk