-2

I am trying to add a script to cron jobs to be played daily.

I tried multiple things but no one seems to work.

First I tried to add a script in cron.daily: It s not triggered.

#!/bin/sh

cd ~/foo/
/usr/bin/mvn exec:java -Dexec.mainClass="bar.foo.Main" > ~/foo.log

Then I tried to add a line in crontab using vi crontab same thing

17 *    * * *   root    cd ~/foo/ && /usr/bin/mvn exec:java -Dexec.mainClass="bar.foo.Main" > ~/foo.log

Then I tried to use crontab -e and add the same line than before : nothing.

It s the first time I tried to launch a periodic script... Is there something to restart?

PS : Why vi crontab and crontab -e don't display the same thing?

Labe
  • 101
  • 1
  • 3

1 Answers1

0

Make sure your script is executable

chmod +x yourscript.sh