I am wondering if there is a way to assign a short name to your repositories? Having to type in for example, s3://example.us@s3.us-east1.cloud.container-storage.app.cloud/picturebackup to look at a repository is cumbersome and time consuming. It would be great if you had a way to assign a name like
mycloudbackup to it.
If you want the ability to do this right now, I think using one of the restic configuration wrappers/profile managers written by the community is the way to go. I’ve personally used and been happy with both crestic and resticprofile, and browsing the recipes section of the forum should showcase other options.
No need to complicate things - use your shell for what it’s designed to provide.
E.g. put mycloudbackup=s3://example.us@s3.us-east1.cloud.container-storage.app.cloud/picturebackup in your ~/.profile and then run restic -r $mycloudbackup snapshots (after sourcing or in a new shell of course).
That’s pretty much exactly what you asked for. You can put multiple “names” (variables) in that file and they’ll all be available for use just as easily.
Is there anyway to add multiple repositories directly to .bashrc since you have to add the export command for the AWS keys, etc.
Your example worked great for my first repository but not sure if .bashrc will be able to distinguish between multiple export AWS lines
I’m sorry, but your question does not make sense. You don’t add repositories to .bashrc, you add whatever shell related stuff you want in there, such as for example environment variables like in our first example.
You can indeed add multiple environment variables, with different names and values, and use those just like the first one in our example. I’m not really sure what you are asking.
I have to run the following commands from my bash shell FIRST:
export AWS_SECRET_ACCESS_KEY="
export AWS_ACCESS_KEY_ID=
Once I run these then I can run the command example you gave me:
restic -r $mycloudbackup snapshots
So let’s say I have another called $mycloudbackup2. I would have to rerun those export commands manually from my shell first BEFORE I would be able to call the repository:
restic -r $mycloudbackup2 snapshots
So I guess I would need to know if there is a way to call the AWS stuff from the .bashrc entry