Fitus / Zaloha2.sh

Small and simple directory synchronizer (a BASH script)
MIT License
82 stars 12 forks source link

[feature req] default option "y" #8

Open Unixware opened 1 year ago

Unixware commented 1 year ago

def this is missing... you may use this batch to backup only a directory, but for multiple backups on one script this is PITA, not to mention is useless as automatic script (eg on cron)

Fitus commented 1 year ago

Hi Unixware,

I understand you want to set up automatic operations (cron) and the interactions (questions) disturb you.

You can use the --noExec option: Zaloha then only prepares the execution scripts (which requires no interactions/questions) and then it finishes without actually executing them.

This is described in detail in the docu under Automatic operations, including necessary cautions.

Ad feature request: I reject it for this reason: Users of wildly varying levels use Zaloha. So I don't move any millimeter towards a potential complaint like "I used your script with options XYZ (found somewhere (and applied without much understanding)) and now all my data is gone".

(I have seen on the Internet complaints about such events occurring with competitor programs of Zaloha).

Thanks for understanding.

Regards, F.

amp9020 commented 11 months ago

@Fitus Greetings!

Is it possible to make a .CONF file to read?

new file: settings.conf

By default if you run zaloha no settings.conf is read and the default behavior is executed (to prompt).

If you add a feature to read a config file, perhaps the user can add the settings they want.

You can write the option to "yes to all" in the settings.conf and the user would have to uncomment it to use it.

In addition the benefits of reading a settings.conf file users can pre-define the other settings (like source directory, target directory etc).

You can use it so like this:

Zaloha2.sh --config-file=settings.conf

amp9020 commented 11 months ago

Just to be clear on my ask for --yes-to-all would only be applicable if --noRemove was present.

That way i am saying 'yes to all' to just adding new files and subdirectories to test_backup (and/or update existing files in there)

Fitus commented 11 months ago

Hi amp9020,

thanks for your interest.

Ad settings.conf: Sorry, no. This would bring further inflation of LoC + further complexity. KISS = Keep It Stupid and Simple: All info is communicated to the script via command-line options. Also: Set-up one wrapper script for each of your synchronization tasks: This is how I do it on my prod machines and it works fine.

Ad Yes-To-All: For reasons already given, I do not add such option to be available to the general public. I do not want any complaints that somebody somewhere has lost his/her data! But, guys: It looks you do not like the approach described under Automatic Operations. And it looks you are experienced IT men. And Zaloha2.sh is just an ASCII text file, editable by any text editor. So if you - on your own machines and at your own responsibility and liability - make your own version that is without the interactions, then I cannot prevent you from doing so.

BR F.