Hi,
Not sure whether this is the right place to post it. I decided to post it here 'coz Advanced and Expert users will most likely have the answer to what I am looking for.
I want to backup scripts that I have access to to a tar file file and zip it. At the moment I am creating a directory that sort of mimic the directory structure that contains the file that I want to backup.
For example, the source directory make look like this:
/u01/db/mysql
/u01/db/mysql/scripts
/u01/db/mysql/scripts/user01
/u01/db/mysql/scripts/user02
/u01/db/mysql/sql
And at the moment, I am creating a backup directory script that look like below:
/u02/bak/db/mysql
/u02/bak/db/mysql/scripts
/u02/bak/db/mysql/scripts/user01
/u02/bak/db/mysql/scripts/user02
/u02/bak/db/mysql/sql
I then manually copy the file from each directory, the .sh, .ksh, .sql, .log etc. to each directory, then I do below.
cd /u02
tar -cvf bak.tar ./bak
gzip bak,tar
As you may have guess, this takes a loooong time So I am wanting to know if someone can recommend a short process that will more or less give the same result.
In its simplest form, I want to find files of .sh, .ksh, .sql and other file types tar them to a file and gzip the tar file. I only want to find files that I have permission to. Yeah, some of the files are root owned and I do get permission denied when I am doing the cp manually
Kinda hoping that maybe someone had done a similar thing of what I am trying to do, preferably a script. Any advice will be very much appreciated. Thanks in advance.