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

    Cron job on pfSense, how to create one?

    Scheduled Pinned Locked Moved Off-Topic & Non-Support Discussion
    3 Posts 3 Posters 55.9k Views
    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
      MindTwist
      last edited by

      It might seem quite obvious how to put a new cron job on pfSense, but it isn't working for me and my knowledge is quite limited to troubleshoot.

      I download my current config, I search for the <cron>and</cron> on there. Restore config file, pfSense reboots, and everything is ok.

      		 <minute>0</minute>
      			<hour>1,13</hour>
      			<mday>*</mday>
      			<month>*</month>
      			<wday>*</wday>
      			<who>root</who>
      			<command></command>/usr/bin/tar -czf /cf/conf/rrd.tgz -C /var/db/rrd/*.rrd 
      

      I have tried all kind of minute, hour, and I am unable to know why this would not be working looking at the other preconfigured cron jobs. I tried to run it once a day, at a given hour/minute, at a given hour, at several hours daily,… with no results.

      If I run the command /usr/bin/tar -czf /cf/conf/rrd.tgz -C /var/db/rrd/*.rrd from the Webgui -> Status -> Command prompt, it does work. I doo a "ls -la /cf/conf" and I see the newly created rrd.tgz with the current date/time.

      I am just trying to set up a cron job that will do a backup of the RRD data twice a day on the embedded version, so if the power goes out I will lose no more than 12h of RRD data.

      Thanks!

      1 Reply Last reply Reply Quote 0
      • F
        fabifri
        last edited by

        Pushing the thread up!

        Does anyone know a solution till now?

        1 Reply Last reply Reply Quote 0
        • R
          rocky
          last edited by

          I just login to the shell (of pfSense firewall) and setup my cron jobs by

          $ crontab -e

          At least this works here :) My cron jobs list:

          $ crontab -l
          */1 * * * * /usr/sbin/arp -an > /root/arp

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