Git Product home page Git Product logo

Comments (8)

cupcakearmy avatar cupcakearmy commented on July 17, 2024

Thanks ❤️

Mhh ok that is interesting... is there something in /var/log/autorestic.log?
The config files look fine to me.

from autorestic.

adsanz avatar adsanz commented on July 17, 2024

Shows exactly the same as the output from autorestic -c /root/.autorestic.yml cron the only thing that changes every day is the day itself, so if today it gives this: Skipping. Scheduled for: Sat Nov 14 2020 00:00:00 GMT+0000 tomorrow it will show this Skipping. Scheduled for: Sat Nov 15 2020 00:00:00 GMT+0000

Could it be something related to using 0 0 * * * as the cron value?

from autorestic.

cupcakearmy avatar cupcakearmy commented on July 17, 2024

Mhh that is kind of weird.. I'll see tomorrow if i can manage to replicate somenthing like that and look at the code.

from autorestic.

adsanz avatar adsanz commented on July 17, 2024

Hello, I'm going to add something interesting I found... So I've changed the hour to 3AM and now I got this (from autorestic.log):

Running cron jobs
files ▶ Skipping. Scheduled for: Tue Nov 17 2020 03:00:00 GMT+0000

Finished! 🎉

Configuring Backends

Running cron jobs <- looks like it's running the cron job?

Finished! 🎉

Configuring Backends

Running cron jobs
files ▶ Skipping. Scheduled for: Wed Nov 18 2020 03:00:00 GMT+0000

Finished! 🎉

However when I check the snapshots, I only see 2, which are the ones I created manually 🤔

root@matchbox:~# autorestic exec -a snapshots

sftp:

ID        Time                 Host        Tags        Paths
-----------------------------------------------------------------
0e55331e  2020-10-19 08:00:58  matchbox                /src/media
c4d45bc4  2020-11-13 11:49:20  matchbox                /src/media
-----------------------------------------------------------------
2 snapshots 

I think it may be related to SFTP connection via cron? I'm going to make some trial and error, if I find something else I'll post it as a comment

from autorestic.

adsanz avatar adsanz commented on July 17, 2024

I made a simple cron test connecting to the SFTP server, looks like it could be related to autorestic not finding sftp executable!

Subject: Cron <root@matchbox> sftp my-sftp.server.com <<EOF mkdir test bye EOF
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Cron-Env: <PATH=/usr/local/sbin:/usr/local/bin>
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <LOGNAME=root>
Message-Id: <20201117101101.582FE16140C@matchbox>
Date: Tue, 17 Nov 2020 10:11:01 +0000 (UTC)
X-IMAPbase: 1605607935 3
Status: O
X-UID: 2

/bin/sh: 1: sftp: not found <- here

I've added the sftp path to the cron file so now it looks like this:

PATH="/usr/local/sbin:/usr/local/bin:/usr/bin" <- usr/bin added
*/10 * * * * autorestic -c /root/.autorestic.yml cron >> /var/log/autorestic.log 2>&1

If this works out I'll close the issue.

However, maybe adding a fail check or a warning if the sftp executable or similar is not found would be nice

from autorestic.

adsanz avatar adsanz commented on July 17, 2024

Looks like the SFTP executable was the issue. I've changed the cron jobs to execute every 10 minutes to test it and it works:

root@matchbox:~# autorestic exec -a snapshots

sftp:

ID        Time                 Host        Tags        Paths
-----------------------------------------------------------------
0e55331e  2020-10-19 08:00:58  matchbox                /src/media
c4d45bc4  2020-11-13 11:49:20  matchbox                /src/media
cf8a0ff4  2020-11-17 10:50:02  matchbox                /src/media
-----------------------------------------------------------------
3 snapshots 
root@matchbox:~# date
Tue Nov 17 10:54:51 UTC 2020

I'll close the issue, maybe a check on autorestic itself if any location executable is not found would be nice to have

from autorestic.

cupcakearmy avatar cupcakearmy commented on July 17, 2024

Very interesting!
SFTP it restic internal not autorstic. But I'll add it into the docs.
Thanks for the info :)

from autorestic.

cupcakearmy avatar cupcakearmy commented on July 17, 2024

Nvm, it's actually already in the docs :) https://autorestic.vercel.app/location/cron#code3-l2

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.