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

    Delay command after boot

    Scheduled Pinned Locked Moved General pfSense Questions
    9 Posts 2 Posters 845 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.
    • S
      sikita
      last edited by

      Hi, is there any guide how to run a command after boot with some delay - let say in minutes? I would like to wake-on-lan other devices after boot but with some safety delay in case of another power outage. Thank you for ideas.

      kiokomanK 1 Reply Last reply Reply Quote 0
      • kiokomanK
        kiokoman LAYER 8 @sikita
        last edited by

        @sikita
        you can install from package manager -> cron
        or -> shellcmd

        ̿' ̿'\̵͇̿̿\з=(◕_◕)=ε/̵͇̿̿/'̿'̿ ̿
        Please do not use chat/PM to ask for help
        we must focus on silencing this @guest character. we must make up lies and alter the copyrights !
        Don't forget to Upvote with the 👍 button for any post you find to be helpful.

        S 1 Reply Last reply Reply Quote 0
        • S
          sikita @kiokoman
          last edited by

          @kiokoman How can I delay that using cron or shellcmd? For example to run command 30minutes after boot?

          kiokomanK 1 Reply Last reply Reply Quote 0
          • kiokomanK
            kiokoman LAYER 8 @sikita
            last edited by

            @sikita
            @reboot sleep 1800 && my_script.sh
            ?

            ̿' ̿'\̵͇̿̿\з=(◕_◕)=ε/̵͇̿̿/'̿'̿ ̿
            Please do not use chat/PM to ask for help
            we must focus on silencing this @guest character. we must make up lies and alter the copyrights !
            Don't forget to Upvote with the 👍 button for any post you find to be helpful.

            S 1 Reply Last reply Reply Quote 0
            • S
              sikita @kiokoman
              last edited by

              @kiokoman said in Delay command after boot:

              @reboot sleep 1800

              thanks, but cron or shellcmd allows @reboot ? I would prefer to run command directly instead of script.sh

              kiokomanK 1 Reply Last reply Reply Quote 0
              • kiokomanK
                kiokoman LAYER 8 @sikita
                last edited by kiokoman

                @sikita
                cron -> @reboot sleep 1800 && my_script.sh
                for shellcmd idk maybe you put the sleep 1800 inside my_script.sh
                https://docs.netgate.com/pfsense/en/latest/development/boot-commands.html#shell-script-option

                for cron you can use the command instead of my_script.sh

                ̿' ̿'\̵͇̿̿\з=(◕_◕)=ε/̵͇̿̿/'̿'̿ ̿
                Please do not use chat/PM to ask for help
                we must focus on silencing this @guest character. we must make up lies and alter the copyrights !
                Don't forget to Upvote with the 👍 button for any post you find to be helpful.

                S 1 Reply Last reply Reply Quote 0
                • S
                  sikita @kiokoman
                  last edited by

                  @kiokoman Thank you, sorry but I still do not know how to add "@reboot sleep" into the cron. Can you be more detailed in this please?

                  kiokomanK 1 Reply Last reply Reply Quote 0
                  • kiokomanK
                    kiokoman LAYER 8 @sikita
                    last edited by

                    @sikita

                    Immagine.jpg

                    ̿' ̿'\̵͇̿̿\з=(◕_◕)=ε/̵͇̿̿/'̿'̿ ̿
                    Please do not use chat/PM to ask for help
                    we must focus on silencing this @guest character. we must make up lies and alter the copyrights !
                    Don't forget to Upvote with the 👍 button for any post you find to be helpful.

                    S 1 Reply Last reply Reply Quote 1
                    • S
                      sikita @kiokoman
                      last edited by

                      @kiokoman Ok, thanks, will try that.

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