Comments (10)
sudo systemctl start [email protected]
worked! Ill check tomorrow and see if it went off at midnight as expected.
from restic-automatic-backup-scheduler.
More info:
pi@mypi:~$ ls -lah /etc/restic/
total 24K
drwxr-xr-x 2 root root 4.0K May 11 12:56 .
drwxr-xr-x 94 root root 4.0K May 11 11:56 ..
-rw------- 1 root root 139 May 11 11:56 backup_exclude.txt
-rw------- 1 root root 2.1K May 11 12:31 default.env.sh
-rw------- 1 root root 1.7K May 11 12:49 _global.env.sh
-rw------- 1 root root 29 May 11 11:56 pw.txt
This is immediately after running:
$ git clone https://github.com/erikw/restic-automatic-backup-scheduler.git && cd $(basename "$_" .git)
and
sudo make install-systemd
from restic-automatic-backup-scheduler.
Hm I would be interested to know what shell is being invoked by your sudo. Not all shells support the source
command. This project was written with bash in mind, but is known to will with zsh as well. Plain sh
would use the command .
instead of source
.
from restic-automatic-backup-scheduler.
pi@mypi:~$ echo "$SHELL"
/bin/bash
pi@mypi:~$ source
-bash: source: filename argument required
source: usage: source filename [arguments]
pi@mypi:~$ .
-bash: .: filename argument required
.: usage: . filename [arguments]
from restic-automatic-backup-scheduler.
Ok looks good. Does it work to enter an interactive shell and then source? I.e.
$ sudo -s # or sudo -i
# source /etc/restic/default.env.sh
from restic-automatic-backup-scheduler.
@erikw Yeah it dopes but then im root and commands like rclone fail because it cant find /home/root/.config/rclone etc.
I need to make another issue but my backups aren't running and theres no output at all in journalctl. This is sort of an X-Y problem I suppose since I cant even source to the current shell and test by running /bin/restic_backup.sh
from restic-automatic-backup-scheduler.
My normal restic command that works is: restic -r rclone:remote:/data1/home/de1913/birdnetpi snapshots
pi@mypi:~/BirdNET-Pi$ sudo -s
root@mypi:/home/pi/BirdNET-Pi# source /etc/restic/default.env.sh
root@mypi:/home/pi/BirdNET-Pi# /bin/restic_backup.sh
B2_ACCOUNT_ID must be set for this script to work.
Did you forget to source a /etc/restic/*.env.sh profile in the current shell before executing this script?
root@mypi:/home/pi/BirdNET-Pi#
root@mypi:/home/pi/BirdNET-Pi# cat /etc/restic/_global.env.sh
# The restic repository encryption key
export RESTIC_PASSWORD_FILE="/etc/restic/pw.txt"
# The global restic exclude file
export RESTIC_BACKUP_EXCLUDE_FILE="/etc/restic/backup_exclude.txt"
export RESTIC_VERBOSITY_LEVEL=1
export RESTIC_NOTIFY_BACKUP_STATS=false
# shellcheck source=etc/restic/_global.env.sh
. "/etc/restic/_global.env.sh"
export RESTIC_REPOSITORY="rclone:remote:/data1/home/de1913/birdnetpi" # *EDIT* fill with your repo name
# What to backup. Colon-separated paths e.g. to different mountpoints "/home:/mnt/usb_disk".
# To backup only your home directory, set "/home/your-user"
export RESTIC_BACKUP_PATHS="BirdNET-Pi/scripts/birds.db:BirdSongs/Extracted/By_Date/"
# A tag to identify backup snapshots.
export RESTIC_BACKUP_TAG=systemd.timer
# Retention policy - How many backups to keep.
export RESTIC_RETENTION_DAYS=14
export RESTIC_RETENTION_WEEKS=16
export RESTIC_RETENTION_MONTHS=18
export RESTIC_RETENTION_YEARS=3
from restic-automatic-backup-scheduler.
This is the key:
root@mypi:/home/pi/BirdNET-Pi# /bin/restic_backup.sh
B2_ACCOUNT_ID must be set for this script to work.
The problem is exactly as the message says. This script is written with using B2 in mind. I see your storage backed is rclone. See here the default profile:
https://github.com/erikw/restic-automatic-backup-scheduler/blob/main/etc/restic/_global.env.sh#L19
To use rclone, you would need to modify the solution just slightly.
If you are lucky, you would just need to remove the B2 envvars from here:
https://github.com/erikw/restic-automatic-backup-scheduler/blob/main/bin/restic_backup.sh#L36
YMMV I've not used the rclone storage backend myself:)
from restic-automatic-backup-scheduler.
Okay that helped, simply gutting the B2_*
stuff from /bin/restic_backup.sh
allowed me to run /bin/restic_backup.sh
manually and see a successful backup. For rclone, I needed to add the following env vars:
export RCLONE_CONFIG_REMOTENAME_TYPE=sftp
export RCLONE_CONFIG_REMOTENAME_HOST=myuser.rsync.net
export RCLONE_CONFIG_REMOTENAME_USER=myuser
export RCLONE_CONFIG_REMOTENAME_PORT=22
export RCLONE_CONFIG_REMOTENAME_KEY_FILE=/home/pi/.ssh/myuser_rsync_id_rsa
This is because rclone will not be able to find its config when run as root. I suppose I could also move/link the config in roots/.config folder too.
@erikw to test the timer, how can I manually trigger the systemd timer?
from restic-automatic-backup-scheduler.
Great, issue resolved:)
@erikw to test the timer, how can I manually trigger the systemd timer?
See
https://github.com/erikw/restic-automatic-backup-scheduler#7-backup-automatically
The --now
should run it directly.
It should be possible to start the service manually too, something like
# systemctl start [email protected]
from restic-automatic-backup-scheduler.
Related Issues (20)
- Systemd unit need both Requires and After for nm-unmetered-connection to work HOT 1
- plist Being Overwritten by Brew HOT 1
- Run backup as restic user HOT 2
- Mac OS LaunchAgent HOT 2
- How to allow user unmount? HOT 1
- Revise non-optional settings HOT 1
- Allow space in extra args HOT 4
- Install fails on windows, pwsh not found HOT 4
- Improve resilience of systemd-backup task HOT 2
- [BUG] Retention periods are being ignored by restic forget when "${extra_args[@]}" is empty HOT 7
- Install fails on windows, pwsh not found HOT 6
- restic_backup.sh backs up supplied paths, but also the folder it's being executed from HOT 13
- As all major OSes are now supported, extract the step-by-step and tl;dr to a general section, and link to OS specifics?Or other way around, from OS specific, link to general step-by-step and have TL;DR for each OS.
- Implement forgotten restic-check LaunchAgent
- Can't find both restic-backup.service and status-email-user.service HOT 1
- resticw error HOT 3
- How to set tag name using resticw?
- line 77: extra_args[@]: unbound variable HOT 7
- Run a backup on demand? Storage backends other than Backblaze? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from restic-automatic-backup-scheduler.