PDA

View Full Version : An Interesting Scenario



OperatorOne
24th May 2006, 08:44 PM
I have a process at work that I am forced to undergoe twice daily simply because whoever constructed our network was not as adept as they should have been (for lack of a better way to say it).

Here' s the process I undergoe... then I am curious if I can use the power of Linux to script this entire process so I can load the script on to one of our Linux servers and leave it alone....

1) I logon to a server in a remote location, and use a program called Agent Ransack to locate files in a given directory that are new (searching by date and looking for all files since the date in the search tool.... today I would use 5/23/2006 and it would give me all files dropped after 5/23/2006 at 12:00am until present).

2) I take these files, copy them to a temp location and then package them in a zip file.

3) I connect to a share on a local server and move the zip file there.
4) I disconnect from the offsite server, connect to the local one, and unpack the files wher eI need them to be, and then clean up all of my temp files.
5) I send an email to 4 people telling them this has occured.

I have tons of horsepower on my network and plenty of Redhat ENT servers running so I can make this work I just do not have the Linux experience to do it.

My initial idea was to map each share to a local mount point, i.e. /media/remoteshare and /media/localshare and then use a script to identify which files were new in the remoteshare folder and rsync them with the localshare folder.

the drawback to this is that while the remote folder will always have new files, and will build for an undetermined period (I have no control over archiving), we archive the local box every three months, so I need the process to move sync files that are new only for the past three months.

I hope this wasn't too confusing... anyone with any smokin ideas I'm ready to hear them. I cannot change this process, so there's no use trying to convince my superiors otherwise, they are set in their way, no matter how lame, and I need to work within that paradigm.

cheers

ccrvic
24th May 2006, 09:23 PM
1) I logon to a server in a remote location, and use a program called Agent Ransack to locate files in a given directory that are new (searching by date and looking for all files since the date in the search tool.... today I would use 5/23/2006 and it would give me all files dropped after 5/23/2006 at 12:00am until present).

2) I take these files, copy them to a temp location and then package them in a zip file.

3) I connect to a share on a local server and move the zip file there.
4) I disconnect from the offsite server, connect to the local one, and unpack the files wher eI need them to be, and then clean up all of my temp files.

rsync will do all that for you. Over an encrypted connection, if you want.


5) I send an email to 4 people telling them this has occured.

If you run rsync from a cron job, cron will mail the results to whomever you want.

Vic.

OperatorOne
24th May 2006, 09:24 PM
nice. So it sounds like I just need to spend more time reading about the rsync command.

ccrvic
24th May 2006, 09:28 PM
nice. So it sounds like I just need to spend more time reading about the rsync command.

Yep. rsync is your friend.

"-a -e ssh" is a good set of options...

Read up on RSA-key logins as well - that way, your machines can shell into each other without you having to put a password into any scripts...

Vic.