Batch Copy Files & Rename - Assistance
by orangepeel190 from LinuxQuestions.org on (#577NF)
Hi There
I am looking at developing a script that basically creates a copy of the script files to a particular directory - say once a week. I don't want my fat fingers to loose the entire file - the last weeks changes would be fine. I can then export the backup folder off site or to another location.
Most of the script files (99%) do not contain a file extension, only a small amount have the .sh or .conf or similar extensions.
One of the main issues that I am having is that I am attempting this (writing the script and running it) under a user privilege (not root). Any scripts that I am attempting is coming to a halt when it comes across a file that is owned by root.
I would like to maybe try and capture the files in this particular director that are owned by root, however as there is only 3-4 files owned by root, I don't mind if they are executed/skipped.
I have tried the long way - writing individual lines of cp into a script but this requires updating very regularly.
I have tried rename - however I cannot get it to work without extensions on the source file.
I don't want to use mv as I am not wanting to move them - just copy them to another location and leave the original/source files alone.
I must be missing a simpler method here?
Any other ideas?
Thank you for your help/guidance


I am looking at developing a script that basically creates a copy of the script files to a particular directory - say once a week. I don't want my fat fingers to loose the entire file - the last weeks changes would be fine. I can then export the backup folder off site or to another location.
Most of the script files (99%) do not contain a file extension, only a small amount have the .sh or .conf or similar extensions.
One of the main issues that I am having is that I am attempting this (writing the script and running it) under a user privilege (not root). Any scripts that I am attempting is coming to a halt when it comes across a file that is owned by root.
I would like to maybe try and capture the files in this particular director that are owned by root, however as there is only 3-4 files owned by root, I don't mind if they are executed/skipped.
I have tried the long way - writing individual lines of cp into a script but this requires updating very regularly.
I have tried rename - however I cannot get it to work without extensions on the source file.
I don't want to use mv as I am not wanting to move them - just copy them to another location and leave the original/source files alone.
I must be missing a simpler method here?
Any other ideas?
Thank you for your help/guidance