Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ElectricRCAircraftGuy opened this issue Mar 16, 2023 · 2 comments

Comments

@ElectricRCAircraftGuy
Copy link
Owner

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 ElectricRCAircraftGuy changed the title Support multiple sets of config files Support multiple sets of config files in dir ~/.eRCaGuy_backup/ Mar 16, 2023
@ElectricRCAircraftGuy
Copy link
Owner Author

ElectricRCAircraftGuy commented Mar 16, 2023

  • Make sure to update the logs to indicate which config dir is being run.

    Ex:

    ~/rsync_logs/to_4TB_hdd/20230316-0900hrs21sec_dryrun/
    
    ~/rsync_logs/default/20230316-0900hrs21sec_dryrun/
    
    # etc. 

    Let the "default" one be a symlink to another name if the default config dir is also a symlink to another name.

@ElectricRCAircraftGuy
Copy link
Owner Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant