ElectricRCAircraftGuy / eRCaGuy_backup

Easily back up your files on any Linux system via a Bash rsync wrapper which supports dry-runs, include & exclude files, and nice logging.
GNU General Public License v3.0
1 stars 0 forks source link

Support multiple sets of config files in dir `~/.eRCaGuy_backup/` #7

Open ElectricRCAircraftGuy opened 1 year ago

ElectricRCAircraftGuy commented 1 year ago

Depends on #6 (which must be done first).

Support multiple sets of config files! Ex: instead of just this:

~/.back_up_linux_pc/config.sh
~/.back_up_linux_pc/files_to_exclude.rsync
~/.back_up_linux_pc/files_to_include.rsync

...use multiple folders, like this:

~/.eRCaGuy_backup/to_4TB_hdd/config.sh
~/.eRCaGuy_backup/to_4TB_hdd/files_to_exclude.rsync
~/.eRCaGuy_backup/to_4TB_hdd/files_to_include.rsync

~/.eRCaGuy_backup/to_2TB_ssd/config.sh
~/.eRCaGuy_backup/to_2TB_ssd/files_to_exclude.rsync
~/.eRCaGuy_backup/to_2TB_ssd/files_to_include.rsync

~/.eRCaGuy_backup/to_thumb_drive1/config.sh
~/.eRCaGuy_backup/to_thumb_drive1/files_to_exclude.rsync
~/.eRCaGuy_backup/to_thumb_drive1/files_to_include.rsync

~/.eRCaGuy_backup/to_thumb_drive2/config.sh
~/.eRCaGuy_backup/to_thumb_drive2/files_to_exclude.rsync
~/.eRCaGuy_backup/to_thumb_drive2/files_to_include.rsync

~/.eRCaGuy_backup/photos_only/config.sh
~/.eRCaGuy_backup/photos_only/files_to_exclude.rsync
~/.eRCaGuy_backup/photos_only/files_to_include.rsync

~/.eRCaGuy_backup/projects/config.sh
~/.eRCaGuy_backup/projects/files_to_exclude.rsync
~/.eRCaGuy_backup/projects/files_to_include.rsync

...etc.

Then, you can specify which config to run, like this:

# Format: `<executable> [target]`

gs_back_up_this_pc to_4TB_hdd
gs_back_up_this_pc to_2TB_ssd
gs_back_up_this_pc photos_only
# etc.

If you don't specify a target, it will use default automatically.

Make default simply a symlink to one of the other config options folders, like this:

ln -sir ~/.eRCaGuy_backup/to_2TB_ssd ~/.eRCaGuy_backup/default

Then, when you call the script without specifying a target, that default config folder is what gets automatically used.

gs_back_up_this_pc

# OR (same as above, but explicit)
gs_back_up_this_pc default 
ElectricRCAircraftGuy commented 1 year ago
ElectricRCAircraftGuy commented 1 year ago

Update: The above would be easier if you had a master config file to set the default, rather than relying on the default to be a symlink. So, do that: have a master config file to set a default, instead!