Does the crontab not work ??



  • hi all
    I installed the cron package and created an new con job

    i created a script in /root  (called test.sh)
    when i run it from the command line it goes OK
    but when i define this script in the crontab it won't run the script.  :P

    i also changed the first line in my script to : #!/bin/sh
    but even then it won't run …

    its just a simple sh script ...
    can please anybody tell me what i am doing wrong here ?

    thx
    micheal



  • Have you checked from the command line on the firewall that your crontab is scheduled to run correctly? (crontab -l) Or, alternately, does the crontab exist in the /var/cron/tabs folder?



  • Hi .. what are you using as a shebang path in your script? (the #!/ line at the top).  If you've got that wrong then your script won't execute.

    AFAIK unless you have modified your system your choices are #!/bin/sh or #!/bin/tcsh  - If you are using something from linux bash will NOT work on an unmodified system.

    Have a look at this post: https://forum.pfsense.org/index.php?topic=116494.0  - I had the same problem, although it was with python and not shell, but it's pretty much the same thing.  Modify your script to runs minicron and see if the error shows up in the log.  If it doesn't you can be pretty sure your shebang path is wrong.

    Good luck.


Log in to reply