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

    Pfsense Cron

    Russian
    3
    7
    878
    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.
    • T
      testsia
      last edited by

      Добрый день.
      Не могу настроить cron на выполнение скрипта каждую мину.
      Установил модуль Cron
      Положил скрипт в /home/script/copy_conf.sh
      И прописал в Cron

              • root /bin/sh /home/script/copy_conf.sh
                пробовал
              • root /home/script/copy_conf.sh
                пробовал
                */1 * * * * root /home/script/copy_conf.sh

      не выполняет и в логах пусто.
      Кто сталкивался помогите решить задачу.

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

        А сделал исполняемым скрипт? chmod +x /home/script/copy_conf.sh

        1 Reply Last reply Reply Quote 0
        • werterW
          werter
          last edited by werter

          @testsia
          Содержимое скрипта покажите.

          https://www.shellcheck.net/
          https://crontab.guru/

          1 Reply Last reply Reply Quote 0
          • T
            testsia
            last edited by

            Да файл исполняемый.
            Вот сам скрипт:
            cat /home/script/copy_conf.sh
            #!/bin/sh
            cd /tftpboot/configs/
            curl http://192.168.102.38/tsmon/configs/thinstation.hosts --output thinstation.hosts

            ls -la /home/script/
            total 24
            drwxr-xr-x 2 root wheel 512 Jun 10 17:17 .
            drwxr-xr-x 9 root wheel 512 Jun 10 17:17 ..
            -rwxrwxrwx 1 777 wheel 118 Jun 12 09:58 copy_conf.sh

            Не понимаю чего не работает .......

            `

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

              А сам скрипт вручную запускается? Проблема в cron или в самом скрипте?

              1 Reply Last reply Reply Quote 0
              • werterW
                werter
                last edited by werter

                Зачем скриптом-то в вашем случае? Зачем попаболь?

                В Cron-е от root:
                2019-06-13 18_58_24-.png
                или
                2019-06-13 19_03_00.png
                -s - silent
                Всё.

                Зы. Если вы пф как TFTP-сервер решили пользовать, то может понадобится правило fw на LAN для доступа к порту TFTP на LAN address.

                Зы2. Для PXE оч. хорош https://fogproject.org/
                У меня так с FOG-ом (всё на картинке ниже грузится по PXE, в том числе и развертывание ОС Windows из образа ( пункт Deploy image) ):
                2019-06-13 19_08_27.png

                1 Reply Last reply Reply Quote 0
                • werterW
                  werter
                  last edited by werter

                  Upd.

                  (Старшие) товарищи подсказывают, что which <command> - отстой уже не торт. Правильно и молодежно - command -v <command>

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