Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cron designations #52

Open
nlare opened this issue Jan 20, 2023 · 2 comments
Open

Add cron designations #52

nlare opened this issue Jan 20, 2023 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@nlare
Copy link

nlare commented Jan 20, 2023

I believe this is specific to Debian but cron would not run this script without designating the shell and path priority first:

SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/

Posting this for other noobs such as myself.

@K0p1-Git K0p1-Git added the documentation Improvements or additions to documentation label Jan 23, 2023
@Wizman87
Copy link

Wizman87 commented Feb 14, 2023

The environment variables mentioned should have those values assigned to them by default. I also verified on my end with my Debian GNU/Linux 10 "Buster" installation and the listed environment variables are indeed set to those values. With that said though, if such an issue were to arise for anyone in the future, what you've written here is a good reference point for those that are running bash scripts on other distributions! The default values of these environment variables can be found documented online as well. Lastly, the following terminal command and example(s) or line(s) of code can also be added directly to crontab to specify the specific shell and/or script path desired by the user:

$ crontab -e
* * * * * /bin/bash /root/cloudflare-template.sh
* * * * * /path/to/shell /path/to/cloudflare-template.sh

I hope that helps!

@haciz
Copy link

haciz commented Jun 11, 2024

crontab -e

And then add the line and it will run every 3h

0 */3 * * * /bin/bash cloudflare-ddns-updater/cloudflare-template.sh

to see the current active cron jobs
crontab -l

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

5 participants
@haciz @Wizman87 @K0p1-Git @nlare and others