crontab-ui icon indicating copy to clipboard operation
crontab-ui copied to clipboard

Crontab-UI works only manually

Open Co7omo opened this issue 5 years ago • 20 comments

Jobs works only if ran manually.

Also no log is written even when ran manully

Co7omo avatar Nov 04 '18 10:11 Co7omo

Any workaround to fix this issue ?

rwibowo avatar Jan 06 '19 23:01 rwibowo

If you run crontab-ui using CentOS, you need to change CRON_PATH to /var/spool/cron It is working for me, and don't forget to press green "Save to crontab" button.

export CRON_PATH=/var/spool/cron

rwibowo avatar Jan 07 '19 12:01 rwibowo

@Co7omo What do you mean by "If ran manually" ?

@rwibowo Thanks for the info!

alseambusher avatar Jan 07 '19 21:01 alseambusher

same here. script only run if I press 'run' manually in the console

lincolnaleixo avatar Jan 22 '19 14:01 lincolnaleixo

Hi,

I've got similar problem, I can add/edit/delete jobs from the interface, however, as shown in the image attached, my job is always with 'RUN' button looks like the script is not started at all. I can run it manually by pressing the 'RUN' button, the jobs is executed, but not automatically.

screenshot 2019-01-29 at 17 54 12

I've started crontab-ui.js with pm2 as suggested in the documentation to have it as a service and it look like is running ok without error(s) (see below)

screenshot 2019-01-29 at 17 59 22

Last but not least, there is not log(s) created under crontab-ui/crontabs/logs directory. Even if the enable logging checkbox is checked.

Any clue over these issues? I really like your tool, its great help for our people.

Thanks in advance

horkko avatar Jan 29 '19 17:01 horkko

I was experiencing this issue as well, in my case, I was trying to curl a command. Turns out with cron you must in some cases specify the full path to your binary (e.g. "/usr/bin/curl" instead of "curl"). You can also set up the PATH variable in the crontab-ui interface. Also, there are disallowed chars in cron such as "%" which will render as newline. I was seeing this since my curled url contained HTML escaping. You will need to escape them in the crontab file (ex. "\%" )

vicwomg avatar Feb 14 '19 19:02 vicwomg

@Co7omo Hey. you can run it deamon with pm2 (sudo npm install pm2 -g). At command run env HOST=0.0.0.0 pm2 start crontab-ui -- --autosave. It work for me.

Nguyenanh avatar May 20 '19 04:05 Nguyenanh

I am experiencing this issue to date.

node version: 12.13.0 npm version: 6.12.0

I am able to create jobs and click run to fire the job no problem; however, a ping to google scheduled for every minute never gets ran.

The first issue I come across in this process is attempting to use pm2 command pm2 start crontab-ui pm2 error log for this command is as follows: image

Secondly, I may click the run button to get a ping to google when running the UI without pm2. At each minute with my cron statement I expect a ping every minutes but it seems to be doing nothing.

Here I expect to print out by 11:34 and nothing occurred: image

Any potential update with this issue/how to get it working for demonstration purposes.

GregoryVillareal avatar Nov 06 '19 16:11 GregoryVillareal

@GregoryVillareal Did you click save to crontab?

alseambusher avatar Nov 07 '19 00:11 alseambusher

@alseambusher Yes, saving to crontab results in this error: image

I've tried to find the log file; though it isn't shown in this directory: image

GregoryVillareal avatar Nov 07 '19 19:11 GregoryVillareal

@GregoryVillareal are you using windows? This works only on linux/unix and mac like OSes.

alseambusher avatar Nov 27 '19 06:11 alseambusher

For me it was because I forgot to save to crontab :( Not very intuitive! Why can't this be done when ever one edits a job?

caco3 avatar Nov 29 '19 23:11 caco3

@caco3 you can use the --autosave option if you don't want to click on 'save to crontab'.

I made it optional because if this was default and you make some mistake while adding a job, it would mess up all other running jobs. This would be bad in a production environment.

alseambusher avatar Dec 04 '19 15:12 alseambusher

@alseambusher Can you add a marker in the ui for each unsaved but edited cronjob. That helps one to realise that it isn't saved. It took me some time to figure out what was wrong, and that I have to press "Save to Crontab" every time.

abdatta avatar Feb 13 '20 08:02 abdatta

@alseambusher Yes, saving to crontab results in this error: image

I've tried to find the log file; though it isn't shown in this directory: image

I hade same problem, what solved it was to set "HOME=/home/cronjob" in environment variable i use systemd to run this and have following in the file "/etc/systemd/system/crontab-ui.service"

[Unit] Description=Crontab-ui Server After=network.target syslog.target

[Service] Type=simple ExecStart=/home/cronjob/node/bin/node /home/cronjob/node_modules/crontab-ui/bin/crontab-ui WorkingDirectory=/home/cronjob/ Restart=always # If set to always, the service will be restarted regardless of whether it exited cleanly or no$ RestartSec=10 # Restart service after 10 seconds if node service crashes StandardOutput=syslog # Output to syslog StandardError=syslog # Output to syslog SyslogIdentifier=Crontab-UI User=cronjob Group=cronjob Environment=HOST=cron02.dc01 Environment=PORT=8000 Environment=BASIC_AUTH_USER=**** Environment=BASIC_AUTH_PWD=**** Environment=HOME=/home/cronjob

[Install] WantedBy=multi-user.target

HMS-WebHub avatar Mar 12 '20 13:03 HMS-WebHub

Hello, I have exactly the same, I tried every solution and still the same, this is my command: cd /home/user/Documents/testservice && /usr/bin/dotnet test --filter FullyQualifiedName~Tests.SeleniumTests.Tests.AuthenticationTest.AuthenticationDesktop Tests/Tests.csproj

If I click on Run it works but not automaticly, I set to run this command every 2 minutes something wrong with my command? Only with the root right you can use this command but crontab-ui is open with the root right also Someone can help me?

NamanNacedo avatar May 20 '20 08:05 NamanNacedo

@HMS-WebHub you can find the log in the browser console.

alseambusher avatar Jul 10 '20 14:07 alseambusher

I'm having the same problem.

minecraftchest1 avatar Aug 27 '21 12:08 minecraftchest1

Hi, I have encountered this issue, and was able to fix it by doing the following steps.

I'm using a MAC but I think the fix is similar to other platform as well.

  • Ensure that you are saving to crontab.
  • When you first tried to run crontab-ui and you get a permission error, do not just run the command using sudo instead, change the permission of crontab-ui/crontabs e.g. sudo chmod 777 /usr/local/lib/node_modules/crontab-ui/crontabs
  • Change the permission of the directory where your crontab file is saved, in a mac that is sudo chmod 777 /tmp/crontab

Just try to read the logs when you run crontab-ui as that is extremely useful.

I will try this in a Ubuntu and RHEL VM over the weekend, and will get back here to update this comment.

I hope it helps someone in the future.

benjcabalona1029 avatar Sep 28 '21 02:09 benjcabalona1029

And even more pain if you install it in docker container: /bin/sh: apt-get: not found, sh not found, sudo not found...

dm9tr0 avatar Jul 13 '22 22:07 dm9tr0

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.

stale[bot] avatar Sep 11 '22 23:09 stale[bot]

@GregoryVillareal Did you click save to crontab?

You need to explicitly click on save to crontab in case you make any change to any listed cron. so Ideally all the listed tabs should also be present in Environment Variables tab...Attaching Screenshot savetoCron So finally it worked for me as well, I am using Windows 10

SideeqShafiRather avatar Jan 16 '23 07:01 SideeqShafiRather