Date: Fri, 10 Apr 2020 08:38:54 -0400 From: Jerry <jerry@seibercom.net> To: freebsd-questions@freebsd.org Subject: Re: Cron config for ipfw table Message-ID: <20200410083854.0000516d@seibercom.net> In-Reply-To: <dba61fc0-ca97-d066-06f7-61273e80765b@cloudzeeland.nl> References: <dba61fc0-ca97-d066-06f7-61273e80765b@cloudzeeland.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
--Sig_/682.zK2ad6TRL1P_.gKHmz+ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, 10 Apr 2020 13:51:51 +0200, Jos Chrispijn commented: >I have added a line to my crontab that defines running a script on >reboot: > >@reboot bash /root/cronjobs/reboot.sh & > >This (bash) .sh script should add an updated ipfw table (preventing I=20 >have to run his action manually) but unfortunately no script is >executed on reboot. > >- script is executable >- no action is mentioned in /var/log/cron > >Can you tell me what I do wrong here? Perhaps scheduling this action=20 >_after_ reboot would be the solution? I run several programs upon reboot also. However, I never use "bash" as part of the command. Assuming you have the correct "shebang" in th script, you could just use @reboot /root/cronjobs/reboot.sh & However, I am not sure you need the "&". All cron jobs are run in the background. You might check out this URL: https://help.ubuntu.com/community/CronHowto I would make sure you have the right 'shebang' in the script then remove both 'bash' and the '&' from the command line and see what transpires. You could also experiment with adding "&> /dev/null" sans the quotation marks to the end of the command. By the way, you did make sure that the script is executable, I assume. --=20 Jerry --Sig_/682.zK2ad6TRL1P_.gKHmz+ Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEIQb/tTwl6I1ueEVtOHMGOIfexWQFAl6QaN4ACgkQOHMGOIfe xWQC0AgAuC6Kds24LbUUAKcMCb9JsXWzHnsiehVS2f+1mhy2s3xZZ2o7I18/3bw7 SqrOMGel369dwGuTekPPpWzFRsOcxYxiPx1rFsTmXYeNoBuHRcfUFkVTCLmjkK3O DoTLME0V6rxzr2BMFjii7P+K2vbJp4ozo9NTGf5fqlI5qmLJz0ipyEX8AN6CvkvN yaPWrEdJwiyU03RXqzTNszUs7fXiYYPXM6i/P0jo5tKQfHRgRVnZhqUTBVRIm46a wU/fmBpaQL7MhwOqkM92dJ51BaFUHjP9TPYKvTZKXFIQoc2a2VHuncDDba/6J9m8 Zz+zPqiIKtfx1g146wu4lTrL0D9Iqw== =dP2R -----END PGP SIGNATURE----- --Sig_/682.zK2ad6TRL1P_.gKHmz+--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200410083854.0000516d>