Comments (6)
Hello,
thank you for reporting this. I created a PR fix #48! Could you try out the fix to see if it works also for you?
from restic-automatic-backup-scheduler.
Oh! I realise the above will not work on install, as there's no such file to install 😅
Maybe sth like this?
@for file in $(SRCS_CONF); do \
install -m 0600 $$file $(DEST_CONF)/$(patsubst %.template, %, $$file)
done
But probably the $(RM)
is the more simple way :D
from restic-automatic-backup-scheduler.
@gerardbosch I pushed the $(RM)
approach now.
Yes I've seen #45. I will get to it and look at it properly! I'm working on my email inbox as a stack right now :)
from restic-automatic-backup-scheduler.
My pleasure! One more thing, I'm still a little confused about this:
After looking at this, I'm not very clear what's the purpose of copying (and then keeping) the *.template files into repository's directory: etc/restic/b2_env.sh and etc/restic/b2_pwd.txt, as these files are already installed into the system directories.
After sudo make install
, aren't you directly editing the target system files /etc/restic/b2_pw.txt
and /etc/restic/b2_env.sh
? So what's the point of generating and keeping a repository-local counterparts?
Thx!! :)
from restic-automatic-backup-scheduler.
The feature comes from #15 like you already found. The idea is that many people fork this repostirory, and it would be a catastrophic if someone accidentally committed their b2_pw.txt
in their fork with their password. The idea to prevent this, was to make a template with a different name, and .gitignore
https://github.com/erikw/restic-systemd-automatic-backup/blob/master/.gitignore#L1-L3
theses sensitive files in the local repo in case a user/fork would have them edited.
As you say, it would be enough to do just copy local b2_pw.txt.template
to the target $PREFIX/etc/restic/b2_pw.txt
, but as far as I understand the manual of install(1)
, it does not have the feature of renaming files. Thus a local file b2_pw.txt
must exist.
I guess one could use cp
, but the nice features of install(1)
like setting permissions, or not overwriting existing config, is quite convenient.
We could however delete the local generated files after they have been installed, thus updating the install target for confs to
install-conf: | $(SRCS_CONF)
install -d $(DEST_CONF)
install -m 0600 $(SRCS_CONF) $(DEST_CONF)
+ $(RM) etc/restic/b2_env.sh etc/restic/b2_pw.txt
What do you think @gerardbosch ? )
from restic-automatic-backup-scheduler.
Yey! I think that your suggestion to do a clean up is a good approach as looks less confusing not leaving unused files behind after make
.
but as far as I understand the manual of install(1), it does not have the feature of renaming files. Thus a local file b2_pw.txt must exist.
I don't know much about GNU Make, but do you think that something like this would work? (or if not maybe a simple cp
and chmod
)
install -m 0600 $(patsubst %.template, %, $(SRCS_CONF)) $(DEST_CONF)
I'd like to help with improvements and ideas if you like (I've got something that may help improving the UX of running restic with your script). I guess you've seen a PR I opened yesterday :)
Just let me know :))
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
- Undefined method 'plist_startup' on running service HOT 3
- Support overriding `--group-by` args via env var/config HOT 1
- How to use with minio HOT 1
- `RESTIC_RETENTION_HOURS` is missing from `default.env.sh` file (homebrew macOS)
- How to set tag name using resticw?
- Unable to source in current shell `sudo: source: command not found` HOT 10
- 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.