cronkeep / cronkeep Goto Github PK
View Code? Open in Web Editor NEWWeb-based crontab manager
Home Page: https://www.cronkeep.com
License: Apache License 2.0
Web-based crontab manager
Home Page: https://www.cronkeep.com
License: Apache License 2.0
Sometimes running cron jobs from the interface fails, and it does so in a silent way, still reporting that the job has started.
CronKeep should (better) report that a cron job failed to run and present the user with whatever information it has available (such as the command's output or the return code).
Capturing command output could be tricky to do with the current setup of running the command asynchronously (which is either scheduling it to run immediately using at
, or via proc_open
otherwise). CronKeep currently passes on the intricacies of invoking the process to symfony/Process, which uses proc_open
internally.
We should strive to keep it running separately from Apache, if possible, which is what at
currently does for us.
A nice to have: have output coming up on the screen as the process is being executed (TBD).
CronKeep currently cannot run in an URL alias or subdirectory such as www.example.com/cronkeep/.
Access to cron can be allowed / revoked on a by-user basis by listing such users in /etc/cron.allow
and /etc/cron.deny
.
We should better detect when access is restricted and tell the CronKeep user how to fix it.
Also, details about this condition should be added to the Troubleshooting section of the Installation page.
We should use floating Google-like notifications for Run, Pause and Resume activities.
Using this type of notifications prevents page from scrolling to top when a notification is dispatched and can be seen more easily by our users.
We could use CodeSeven/toastr. Demo here.
Error as reported by CronKeep:
System error You (apache) are not allowed to access to (crontab) because of pam configuration.
Originally found this issue on a CentOS 6.4 server with PHP 5.3.25.
We should better handle this situation (inform the user and present options).
Log entries associated with this situation:
==> /var/log/secure <==
Dec 25 10:49:48 localhost crontab: pam_access(crond:account): login_access: user=apache, from=cron, file=/etc/security/access.conf
==> /var/log/audit/audit.log <==
type=AVC msg=audit(1419504588.145:797): avc: denied { read } for pid=3191 comm="unix_chkpwd" name="shadow" dev=dm-0 ino=394249 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:shadow_t:s0 tclass=file
type=SYSCALL msg=audit(1419504588.145:797): arch=c000003e syscall=2 success=no exit=-13 a0=7ff518d256bb a1=80000 a2=1b6 a3=0 items=0 ppid=3190 pid=3191 auid=500 uid=0 gid=48 euid=0 suid=0 fsuid=0 egid=48 sgid=48 fsgid=48 tty=(none) ses=3 comm="unix_chkpwd" exe="/sbin/unix_chkpwd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)
==> /var/log/secure <==
Dec 25 10:49:48 localhost unix_chkpwd[3191]: could not obtain user info (apache)
Dec 25 10:49:48 localhost crontab: PAM audit_open() failed: Permission denied
Dec 25 10:49:48 localhost crontab: PAM audit_open() failed: Permission denied
==> /var/log/audit/audit.log <==
type=AVC msg=audit(1419504588.146:798): avc: denied { create } for pid=3190 comm="crontab" scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:system_r:httpd_t:s0 tclass=netlink_audit_socket
type=SYSCALL msg=audit(1419504588.146:798): arch=c000003e syscall=41 success=no exit=-13 a0=10 a1=3 a2=9 a3=7fffab7d1ff0 items=0 ppid=2764 pid=3190 auid=500 uid=48 gid=48 euid=0 suid=0 fsuid=0 egid=48 sgid=48 fsgid=48 tty=(none) ses=3 comm="crontab" exe="/usr/bin/crontab" subj=unconfined_u:system_r:httpd_t:s0 key=(null)
Pressing the Escape key while the search field has focus should call .reset()
on the searchService
, so the search field would be cleared and the search be reset.
I have just installed cronkeep getting this error
on Ubuntu 16.04
`Oh Snap!
at is not available on this system. CronKeep uses this slick command internally to run jobs independently from your web server, whenever you hit "Run". This means you could restart your web server and still have the process running in the background.
Here's the raw output from the command that may help you debug this further:
sh: 1: at: not found`
jQuery Validation plugin seems to consider only the custom message for the "required" validation method, and not for "digits".
Rule definition:
'time[specificTime][hour]': {
required: function() {
return assertTime(SPECIFIC_TIME);
},
digits: true,
range: [0, 23]
},
Rule messages:
'time[specificTime][hour]': {
required: 'Hour is required',
digits: 'Hour should be a valid number',
},
All rules are affected.
Validation messages for the Days selector (in the "Monthly" repeat section) and for the Day of Week selector (in the "Weekly" repeat section) are not being removed after the fields become valid.
The selectors are built using toggle-able Bootstrap button groups. We probably need to manually trigger the "change" event on the underlying multi checkbox controls.
Hi,
Want to adapt cronkeep to my server panel that is already installed.
In order to do this and to have cronjobs visible in server panel and in cronkeep i need to make a small modification.
When job is PAUSED it should be like this:
### curl http://google.com
instead of as now: # curl http://google.com
I have already modificed the PAUSE action in Job.php:
protected function _updateRaw()
....
. ($this->_isPaused ? '### ' : '')
But when job gets paused, it is not displayed at all in crons list as it has ###
Please assist, thank you!
We should validate the raw expression ("Time" field) in the Advanced mode of adding / editing cron jobs.
Currently, saving a job with an incorrect time definition is prevented by the crontab utility itself which returns an error message like "-":20: bad day-of-month errors in crontab file, can't install.
I cannot seem to get www-data access to the crontab command.
I've added an entry to the sudoers file:
www-data ALL=(ALL)NOPASSWD:/usr/bin/crontab
Yet it still throws the same error. Am I missing something?
Force a search-themed submit key on Android's keyboard when using the search field.
Right now the submit button is labeled "Start".
How to check crons are working properly?
I want to check last and next execution time of any job
Triggered when trying to save a cron job, from a Callback-type validator.
Found on a PHP 5.3.29-powered environment.
The error handler set by the SlimJson middleware collides with our own error handler. We need to somehow merge the two error handlers.
Right now, any exception thrown in any of the routes returning JSON shows up in the response as {e:{}}
, since the thought-to-be-global error handler overrides the one set by the SlimJson middleware.
It does not execute a created task.
Only if I create as root user.
What should I do?
Please add the time stamp of the active jobs when it was last run.
Also add an option to view log of the cronjob.
do u have any examples how to setup on nginx?
http://cronkeep.ubuntu/: Fatal error: Class 'Slim\Slim' not found in /var/www/cronkeep/src/index.php on line 26
Hello,
I'm new to linux and have installed CronKeep on my raspberry PI 3 (Rasbian) as described. Everything seems to be correct but when I launch CronKeep, all planified jobs were listed correctly on my web browser. The problem is when I run job, its in running... mode for a while and nothing happening. Same when I want add a job or even modify a current job.
I would be very greatful, if anyone help me to solve my problem?
Thanks in advance
With regards
Raphy
We should limit these input type=number elements to 2 digits:
maxlength
doesn't work for number elements, so probably a JavaScript-based approach would be the solution here.
The solution has to account for the fact that contents could be pasted into the field, rather than typed.
Even though such cron jobs are correctly displayed in the jobs grid and new jobs can be added, they can't be edited.
We should add support for the @reboot
time expression to Expression.php
. Users will be able to edit this kind of jobs in the Advanced tab of the Edit form.
Hi,
Recently installed cronkeep on my Raspberry Pi and seems to be perfect for my need.
But I can't add or edit any cron job.
I have the home page, I see a job created manually but can't edit it. I've the error message "CloseUnable to edit the job at this time". In the console, I've an 404 error on the requested page : http://192.168.0.31/job/edit-form/7677c207
If I try to add a new job, the saving button seems always checked after click. And no new job in the crontab.
Tested with Firefox 50.1.0 and Vivaldi 1.6.689.34
Regards,
Nicolas
Consider the following scenario.
Initial contents of the crontab:
# stray comment at the top
# Job 1
* * * * * /job/1
* * * * * /job/2
# stray comment at the top of the crontab
* * * * * /job/2
Cron job is successfully deleted, CronKeep reports the crontab as empty and the actual contents of the underlying crontab are:
# stray comment at the top of the crontab
"Cron job no longer exists" error message is displayed.
This is because the crontab is read again in the delete action, and the hash passed in the delete request no longer matches the hash of the cron which adopts the stray comment above and becomes:
# stray comment at the top of the crontab
* * * * * /job/2
After a job's been added, we need to clear the "active" state on any of the toggle-able buttons in the Add Job dialog (e.g. the day of week selector, the day of month selector).
Error that CronKeep reports:
'/var/spool/cron' is not a directory, bailing out
Somebody else encountered this error:
http://stackoverflow.com/questions/10706031/var-spool-cron-is-not-a-directory-bailing-out-when-trying-to-work-with-cron
We should better handle this situation (inform the user and present options).
Error originally found on CentOS 6.4, PHP 5.3.25.
Getting this fatal error on CentOS 6.5, PHP 5.3.3:
Fatal error: Can't inherit abstract function Zend\Form\LabelAwareInterface::setLabel() (previously declared abstract in Zend\Form\ElementInterface) in /vagrant/src/vendor/zendframework/zend-form/Zend/Form/Element.php on line 21
Tracked this down to zendframework/zendframework#5996.
I did a fresh installation of cronkeep with the exception of running with SSL. I'm not able to edit/delete the default cron job or add a new cron job. Looking at my browser debug window it looks like the JavaScript is referencing the /job/* directory, which I don't have, giving a 404 error. I've made sure www-data has full access to the cronkeep directory; including sub directories. I should also add I'm running this on Raspbian Jessie, which does not use selinux, so I know that's not the issue.
Firefox pre-fills textarea and select elements with a value previously selected, which can break the form, since some JavaScript interactions are never fired for those values.
Currently, Zend Form's view helpers strip away the autocomplete attribute (Zend Framework 2.3.1).
This has already been fixed (zendframework/zendframework#6739). We should link against the new version when it comes available.
Paused (commented) cron jobs are currently showed on a gray background. We should find a way to make them stand out a bit more.
Possible ways to make it happen:
/provision/prevent-running-cron-jobs.patch & /provision/google-analytics-tracking-code.patch are difference file, is it correct ?
used cronkeep on windows 7 with Ubontu VM.
can you please help update the file with correct syntax.
/provision/prevent-running-cron-jobs.patch
diff --git src/index.php src/index.php
index 0247e49..119038b 100644
--- src/index.php
+++ src/index.php
@@ -180,6 +180,12 @@ $app->group('/job', function() use ($app) {
+ $app->render(403, array(
+ 'error' => true,
+ 'msg' => 'Running cron jobs is disabled in the demo application'
+ ));
+ $app->stop();
/provision/google-analytics-tracking-code.patch
diff --git src/application/views/layout.phtml src/application/views/layout.phtml
index a6a1929..2fbea16 100644
--- src/application/views/layout.phtml
+++ src/application/views/layout.phtml
@@ -30,6 +30,16 @@
+ <script>
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+ ga('create', 'UA-58144268-1', 'auto');
+ ga('require', 'linkid', 'linkid.js');
+ ga('send', 'pageview');
+ </script>
</head>
<body>
<!-- Fixed navbar -->
Show a nice crafted error message rather than failing miserably.
After installing via composer on a Linux (Debian Jesse) server, I went to http://[host]/cronkeep/src/ in a browser. I received the following error:
There has been an error reading the crontab. Here's the output from the shell: You (daemon) are not allowed to use this program (crontab) See crontab(1) for more information
Where is crontab(1)
? I couldn't find anything in the Wiki to help.
Currently CronKeep can only interact with the crontab of the user Apache runs as (typically www-data
, apache
or nobody
, depending on the system). Often, this is enough, but we should allow users to interact with crontabs of other users too.
On the back-end, the crontab command invocation should receive the -u
argument to specify the user we are reading / writing the crontab for. We would probably need to add the user a member of the Job
object, so that a job would still be easily identifiable by its hash (and keep the short URLs like /job/pause/af1d7eda
).
On the front-end, we should display a dropdown somewhere. Only users with a non-empty crontab should be initially shown. The list can be expanded to show all system users by selecting the "All Users" option.
Since on most systems Apache doesn't have access to the crontab of other users, instructions on how to grant access rights should be made available as an article linked from the app itself.
Possible ways to implement the user switcher:
We should ask the user for confirmation if he or she tries to close the browser window and the job form is open.
Situations:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.