Git Product home page Git Product logo

Comments (11)

jin-park-dev avatar jin-park-dev commented on July 17, 2024 1

Cron working correctly using

PATH="/usr/local/bin:/usr/bin:/bin"
*/5 * * * * /usr/local/bin/autorestic -c /root/.autorestic.yml cron # Every 5 minutes

Closing :)

from autorestic.

cupcakearmy avatar cupcakearmy commented on July 17, 2024

Damn, then I need to look into it again. This is weird.

from autorestic.

cupcakearmy avatar cupcakearmy commented on July 17, 2024

Oh yes, of course, the docs are wrong, thanks for pointing that out!

from autorestic.

cupcakearmy avatar cupcakearmy commented on July 17, 2024

I just checked and even 0 * * * * /usr/local/bin/autorestic -c /srv/.autorestic.yml cron actually does not work. 😔 No idea why. I need to fix that

from autorestic.

cupcakearmy avatar cupcakearmy commented on July 17, 2024

running /usr/local/bin/autorestic -c /srv/.autorestic.yml cron > /srv/cron.log 2>&1 tells me that restic is not installed. this is quite interesting.

from autorestic.

jin-park-dev avatar jin-park-dev commented on July 17, 2024

Is it previous bug of restic not getting auto installed and need manual installing?

Also I found I need to be on as root (or sudo), otherwise I get errors and it gets bit confused choosing between user and root.

I'll check tomorrow if cron jobs have run.

from autorestic.

cupcakearmy avatar cupcakearmy commented on July 17, 2024

I just found the issue, yes this was an issue before. I pretty sure this time I got the actual answer.
Basically: Cron does not run in a shell, so all the bin paths are not set and no bins are available as a command. So giving the absolute path for autorstic works, but then it cannot find the actual restic command.

Solution:
set path in the cron file

PATH="/usr/local/bin:/usr/bin:/bin"

0 4 * * 1 autorestic -c /srv/.autorestic.yml cron

now we don't even need to pass autorestic as a absolute path.
i will update the docs :)

from autorestic.

cupcakearmy avatar cupcakearmy commented on July 17, 2024

Please do let me know it this solves the issue for you :)
You can append a >> /some/log/file.log 2>&1 to check the output of the cron :)

from autorestic.

cupcakearmy avatar cupcakearmy commented on July 17, 2024

@jin-park-dev docs are updated https://cupcakearmy.github.io/autorestic/location/cron

from autorestic.

jin-park-dev avatar jin-park-dev commented on July 17, 2024

Awesome!

I change crontab with new info. I should find out if backups are happening on 3 machines.

from autorestic.

cupcakearmy avatar cupcakearmy commented on July 17, 2024

@jin-park-dev perfect :) If it works feel free to close the issue. Thanks for reporting!

from autorestic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.