Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Does the crontab not work ??

    General pfSense Questions
    3
    3
    1.8k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      megasounds
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • M
        muswellhillbilly
        last edited by

        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?

        1 Reply Last reply Reply Quote 0
        • G
          guardian Rebel Alliance
          last edited by

          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.

          If you find my post useful, please give it a thumbs up!
          pfSense 2.7.2-RELEASE

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.