Phoenix Down Posted May 12, 2020 Posted May 12, 2020 Hi all, just finished building my new Unraid box and wanted to set up Dynamic DNS. To do so, I just need to do a curl call to a REST endpoint periodically. My work environment is Linux so I'm knee deep in it everyday. So naturally, I started dropping down into the command line to add a line to the crontab. But then, I saw that some threads recommend adding .cron files into /boot/config/plugins/? I looked in the official docs and did not find any guidance on crons. What's wrong with just adding a new entry into root user's crontab? Quote
Squid Posted May 12, 2020 Posted May 12, 2020 7 minutes ago, Phoenix Down said: What's wrong with just adding a new entry into root user's crontab? It won't survive a reboot, unless you add the appropriate commands to /boot/config/go Quote
Phoenix Down Posted May 12, 2020 Author Posted May 12, 2020 (edited) 9 minutes ago, Squid said: It won't survive a reboot, unless you add the appropriate commands to /boot/config/go My first Unraid forum reply, by the the infamous Squid no less! Looks like /boot/config/go just runs a list of commands on startup, right? Are you saying I should write a small script to append my cron entries to the crontab and have that run on startup? What about the /boot/config/plugins/dynamix option others have mentioned? I see a bunch of .cron files there already. Edited May 12, 2020 by Phoenix Down Quote
Squid Posted May 12, 2020 Posted May 12, 2020 4 hours ago, Phoenix Down said: What about the /boot/config/plugins/dynamix option others have mentioned? Preferred Quote
itimpi Posted May 12, 2020 Posted May 12, 2020 5 hours ago, Phoenix Down said: What about the /boot/config/plugins/dynamix option others have mentioned? I see a bunch of .cron files there alread Don’t worry about the others. Whatever is responsible for them will already be set up to re-establish them on a reboot. Quote
Phoenix Down Posted May 12, 2020 Author Posted May 12, 2020 Just to confirm, the recommended way to add new cronjobs is to piggyback on /boot/config/plugins/dynamix by adding your own .cron files there? Quote
Squid Posted May 12, 2020 Posted May 12, 2020 If you know what you're doing (and since you know what cron is and crontab etc), then yes. For everyone else user scripts plugin is the way to go (although it has further options like only run at array start that can't be done via cron) And after you add it then update_cron Quote
Phoenix Down Posted May 12, 2020 Author Posted May 12, 2020 1 hour ago, Squid said: If you know what you're doing (and since you know what cron is and crontab etc), then yes. For everyone else user scripts plugin is the way to go (although it has further options like only run at array start that can't be done via cron) And after you add it then update_cron Got it, thanks! I was about to ask about User Scripts next. So I run "update_cron" after I add a new .cron in /boot/config/plugins/dynamix? Do I need to run "update_cron" after after reboot, or just once? Quote
Phoenix Down Posted May 12, 2020 Author Posted May 12, 2020 4 minutes ago, Squid said: Great, thank you sir! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.