0

I have created a shell script which i want to schedule using cronjob. I used command crontab -e and then i wrote * * * * * /xxxx/xxx/workflow.sh After that i typed :wq!. I got a message saying crontab: installing new crontab but nothing happens after that. I tried running my workflow.sh separately and it is working fine. Below is my workflow.sh.

#!/bin/bash

echo "script started"
python /xxxx/xxx/move_files.py

echo "Training Started"
for N in {1..9}; do /xxxx/xxx/openface-master/util/align-dlib.py /xxxx/xxx/openface-master/training_dataset align outerEyesAndNose /xxxx/xxx/openface-master/aligned_data --size 96 & done

/xxxx/xxx/openface-master/batch-represent/main.lua -outDir /xxxx/xxx/openface-master/feature -data /xxxx/xxx/openface-master/aligned_data

/xxxx/xxx/openface-master/demos/classifier_original.py train feature

echo "Model running"
/xxxx/xxx/openface-master/demos/classifier_updated.py

Please help. I tried removing the file.lock as per suggestion but still it is not working.

Ironman
  • 1,330
  • 2
  • 19
  • 40
  • Check `/var/log/syslog` to see if there are any messages about it. – Barmar Jan 21 '19 at 08:40
  • If `file.lock` is actually preventing the job from running, and you create it but never remove it, I think we have found a bug – tripleee Jan 21 '19 at 08:48
  • @tripleee i tried removing that line where i am creating the lock file using `touch` but still the issue is there. – Ironman Jan 21 '19 at 09:39
  • @Barmar i couldn't able to find `/var/log/syslog` there is no file as syslog – Ironman Jan 21 '19 at 09:41
  • What OS are you running? Different Linux distributions use different log files. – Barmar Jan 21 '19 at 09:42
  • @Barmar i am using centos 7 – Ironman Jan 21 '19 at 09:47
  • [Where to find crontab logs in centos](https://unix.stackexchange.com/questions/176229/where-to-find-the-crontab-logs-in-centos) – Barmar Jan 21 '19 at 09:48
  • We have no idea what this lock file does or doesn't do without looking at the Python code. The way the question is articulated now, only you can determine what its purpose is. Your response indicates that maybe you don't know either. – tripleee Jan 21 '19 at 10:07
  • @tripleee file.lock i used only to check wether my cronjob is working or not. My shell script worked fine when i am running it separately but not working when i am using cronjob to schedule it. I cannot share my python code as per company policies. – Ironman Jan 21 '19 at 11:43
  • If you want this question to be reopened, please [edit] to clarify what troubleshooting steps you have taken. The duplicate question and [the Stack Overflow `crontab` tag info page](/tags/crontab/info) have common troubleshooting steps which you need to perform and document in order to make this a unique and hopefully properly answerable question. – tripleee Jan 21 '19 at 11:48

0 Answers0