changing slurm bash script after submission (I want to change the script for a queuing job to avoid resubmission) - slurm

I have submitted several bash scripts to slurm in a school cluster and there is a long queue. By some chance, I found I made a typo in one of my scripts in a dependence chain. If that is possible to modify the script without canceling the job and resubmission?

Related

Prevent SLURM from running in /home folder

Is there a way for SLURM to prevent users from executing tasks via sbatch or srun that involve writing to the /home/username folder? Can SLURM actually monitor this? If not, what could be a good workaround?
I suppose you could make a job submit script to prevent submitting jobs with a working directory under $HOME, and while that would be a decent hint to users to not do that it wouldn't fundamentally prevent a job from opening files under $HOME.
I guess you could make the home quota small, if you want to prevent running I/O intensive jobs there.

How does Kohana Minion Task?

Good afternoon! There is a site on the Kohana 3.3, which is done sending Email, sms, etc.
Such a question, if we are just 1 minute will launch the task (such as newsletter email), Minion Task allows to perform this task, if it is already running? For example, if it was not completed since the previous start-up and is currently executing?
Minion task has not that functionality.
You have two options:
1. Lock the cron from linux: you can create a shell script that creates a lock file, run your task and delete the lock file at the end and before that check if the file exists to do nothing.
Use some app context variable (i.e.: kohana file cache, database, etc) to create a flag for the task is running and check for this flag in your php code, add the flag if the process is not running and clear it after the process finished.
Hope this help, let me know if you have aby doubt about this solution.

Jenkins running multiple batch files at once

I'm looking for a way to either pause Jenkins or have Jenkins complete a task from a batch file before starting another batch process. Basically what I want is something similar to running:
start /wait batchfile.bat
but when I run this Jenkins just hangs and the process never actually completes. When I run something like this:
run %startpath%\firstbatch.bat
run %startpath%\secondbatch.bat
Jenkins runs both batch files in different threads and this causes a big problem for me. I need the batch processes to complete because they cook and copy assets. The final batch that gets triggered zips the assets and sends them on their way, but if the assets aren't done being copied, the zip starts without all the files in the directory. The only other way I can think of around this is to have each batch in a different build and adding a quiet period to Jenkins but that would just be a guess to how long the batch scripts are actually running for. Thanks in advance.
Try using "call batchfile.bat" That should block until the batch file is done running.
You should create a separate build job for each batch file if you want them to run sequentially, but you don't need to guess how long they will take to run. In the configuration for the job that runs firstbatch.bat, select "Build other projects" in the Post Build Actions section and specify the job that runs secondbatch.bat. This job won't be started until the first job has finished.

Jenkins to monitor external cron jobs

We are using a dedicated Amazon Ubuntu ec2 instance as Cron server, which executed 16 cron jobs at different time intervals i.e, 10 cron jobs in morning 4:15 - 7:15 and the rest # 23:00 - 23:50. I get the results via email. I want to configure something, which shoots email message at the end of they day listing the cron jobs that are executed successfully and the one that failed.
I have a jenkins configured ubuntu instance for auto-building Dev, Beta, Staging & Live environments. Can i add these cron jobs(shell scripts) as external jobs in the jenkins and monitor them. Is it possible?
Definitely possible! You can monitor external cron jobs as described here:
https://wiki.jenkins-ci.org/display/JENKINS/Monitoring+external+jobs
You can also add cron job (-like behavior) to Jenkins by creating a freestyle software project and add "Execute shell" as build process.
It's a bit more convenient since you can also trigger the execution via Jenkins ("Build now").
You might be able to combine the Jenkins monitor external job project type with a matrix project. At the very least the former will enable you to monitor the cron jobs individually.
Alternatively you could have the last monitored cron job of the day trigger building a project that checks the status of all the cron jobs (for example by retrieving and comparing the build numbers of the last and the last successful builds) and sends an email accordingly. The email plugin might be useful for the latter.
Check the CPAN or do some web digging for shell or perl script for managing cron jobs and extend its behaviour to do some reporting which you can render using HTML. Alternatively write a servlet and a some function calls to do just that.
This becomes your own standalone monitor application, which can sit in jenkins or deployed independently. If you choose to add it to jenkins, then add the reporting HTML file and its scripts to the container holding deployed web files for jenkins, word of advice place your files and script in a separate container.
Add a hyperlink to jenkins index html which will load your reporter. Now reboot tomcat and go from there.
Another option could be to take a look at Cronitor (https://cronitor.io). It basically boils down to being a tracking beacon that uses http requests to ping when a cron job/scheduled task starts and ends.
You'll be notified if your job doesn't run on schedule, or if it runs for too long/too short, etc. You can also configure it to send alerts to you via email, sms, but also Slack, Hipchat, Pagerduty and others.

Is there a limit excution time when I run a PHP Script by Cron Jobs?

Is there a limit excution time when I run a PHP Script by Cron Jobs?
For example, I need to backup my big database file through a PHP Script. I set a cronjobs which automatically run everyday.
My question, will the php script run until everything is ok?
ini_set("max_execution_time", "0");
ini_set("max_input_time", "0");
set_time_limit(0);
How I usually set up my cron job scripts is to simply printing everything (especially errors or exceptions) to standard out. To my experience most cron systems will then email the output of the script to whatever local user is running the script. I then have that mail forwarded to my work account to notify me that the script ran and if there were any errors. For basic maintenance scripts that run daily or weekly I've found this to be a quick, effective way to keep me updated on their status.

Resources