Python Script Cron Job

Status
Not open for further replies.

Supa

Patron
Joined
Jan 10, 2014
Messages
204
I want to use this command: 'jexec 7 python /scripts/conv2mp4.py' to encode my media in an automated process. Any idea what would happen if it runs the python script when it's already currently running? Would it Cancel the current process?

I tested the command in shell and it executed fine. But it's not working in a cron job.

2QpkBdv.png
 
Last edited:

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
Any idea what would happen if it runs the python script when it's already currently running?
I would expect it to launch another instance, which may be harmless or harmful, depending on the contents of the script.
Would it Cancel the current process?
No.
 

Supa

Patron
Joined
Jan 10, 2014
Messages
204
Put jail cron on work...

What does this mean?

I tried creating the cronjob inside the jail... with just "crontab -e"

And using something like this:

Code:
*/5 * * * * flock -n /tmp/conv2mp4.lock /usr/local/bin/python /scripts/conv2mp4.py /media/downloads/encode >/var/log/last_conv2mp4.log 2>&1 


I don't even know if I need flock. I just want it to run when it detects a new file in the folder.
 

pasiz

Explorer
Joined
Oct 3, 2016
Messages
62
Write some file to determine cron is running. Try to emulate cron user enviroment and permissions if you test it manually.
 
Status
Not open for further replies.
Top