You need to define clearly the aims, then break them down into smaller tasks. Try to draw the process or write it out. Keep clear that the three basic logical flow types are:-
The sequence can be any number of statements (including the other two) and calls to commands etc.
Is there a reason your peers are 'not recommending'
tar? Do they not trust it, or is it that they just haven't suggested it.
It is nice that your script uses functions (Local2Remote etc.) but as they are called just once, it seems a little odd. Perhaps it makes the main part of the scripts easier to read, but I also worry that you are trying to call
zip within
sftp and I'm not sure it will work.
I would suggest that your two test at the beginning of the main part are the wrong way round. You should test for the lock-file first, then the configuration file.
I'm not too sure on why you
exec < ${FILE_CONFIG} in your code the read in in your loop. Could you just simply
. ${FILE_CONFIG} which will execute the file in the current shell, i.e. any variables or functions set are then available to the script that called it.
Your loop with a
break and the
eval statements are a little perplexing too.
Can you explain what your input file
FILE_CONFIG will contain and the eventual process you want to achieve? There may be a simpler way to get there.
There is definitely some good stuff in the script though, so don't lose confidence. I'm just trying to understand the overall objective and trying to get the best outcome for you in a way that you can maintain.
Robin