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

How to run as cron job? #34

Open
jennso opened this issue Jul 30, 2020 · 2 comments
Open

How to run as cron job? #34

jennso opened this issue Jul 30, 2020 · 2 comments

Comments

@jennso
Copy link

jennso commented Jul 30, 2020

Hi I am trying to figure out how to run this script on a cron job,

this is what I got so far

cron entry:

06 15 * * * /usr/bin/python3 /opt/snapraid-runner-0.4/snapraid-runner.py >> ~/cron.log 2>&1

what I get on the logs is this:

snapraid-runner configuration file not found
usage: snapraid-runner.py [-h] [-c CONFIG] [--no-scrub]

optional arguments:
-h, --help show this help message and exit
-c CONFIG, --conf CONFIG
Configuration file (default: snapraid-runner.conf)
--no-scrub Do not scrub (overrides config)
~
I guess I have to add the configuration file somehow.

Thanks for the amazing script! :)

@StewGoin
Copy link

I would guess you need to specify the location of your snapraid-runner config file (using the -c option) -- my /etc/crontab looks like this (slightly different than running it as a user cron):

00 08 * * * root python3 /opt/snapraid-runner/snapraid-runner.py -c /opt/snapraid-runner/snapraid-runner.conf

@jennso
Copy link
Author

jennso commented Jul 30, 2020

It's working thank you so much I added the root also.

Thanks!

@Chronial Chronial changed the title cron job snapraid runner How to run as cron job? Sep 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants