LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Script as a backup Solution (https://www.linuxquestions.org/questions/linux-software-2/script-as-a-backup-solution-426195/)

shawnbishop 03-19-2006 01:40 AM

Script as a backup Solution
 
Good Day

I have the following problem,I have a SAMBA Server with multiple directories on the server.I want to backup almost 300GB daily,and this is where I have the following problem.

THe directory structure is as follows

/pub/job100/AR - Architect of record
/pub/job100/EE - Electrical Engineer
/pub/job100/ID - Interior Design

/pub/job200/AR - Architect of record
/pub/job200/EE - Electrical Engineer

and so forth. We have multiple jobs,upto 20,but I only want to backup the AR - Architect of Record Directory,as all the other directories are not neccessary.Now sometimes the directory structure has an extra "layer" eg

/pub/job300/Drawings/AR - Architect of Record.

Could somebody show me how to write a script so that I can only backup the AR - Architect of Record directories?

Cheers:confused:

/bin/bash 03-19-2006 03:07 AM

How about this:
for DIR in `find /pub -type d -name AR`; do
#your backup process goes here e.g.
rsync -a /$DIR/ /backup/directory/$DIR/
done

shawnbishop 04-12-2006 08:23 AM

Good Day

I have tried the above and it didnt work,can somebody help me...

REgards

/bin/bash 04-14-2006 08:39 PM

Quote:

I have tried the above and it didnt work
A little more information would help.


All times are GMT -5. The time now is 10:00 PM.