Forum Moderators: coopster

Message Too Old, No Replies

Could not define the logic

on zip upload to wins box then FTP the newer zip

         

henry0

1:31 pm on Dec 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here is what I would like achieving
I collect PHP classes that I might have an interest in
Each class is originally zipped, and on upload goes in a php_classes/ dir

How on a Wins box could I traverse the dir, figure which zip is the newer and auto-ftp it to a remote dir in a *nix box?

Possibly by first Using MS scheduler once during the night (which I never used) to create an array of existing zip, and then the following day by 6pm run a second one, compare the arrays and FTP the missing one or ones
Not sure, it sounds kind of “lot of work” for a simple task

What will you do?

(Reason is: I do not want networking my home office three machines, so if I have interest in something I FTP it to my server RedHat box and grab it back from there – call me paranoiac! But I like the fact that networking may not be used to infest all my machines in one shot-)

coopster

9:54 pm on Dec 14, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Traverse the directory, see if the filemtime for any given file in the directory is >= 24 hours ago. If so, copy the file to it's destination. You could either move it via FTP or copy it across your network. Run the job every night at the same time.

henry0

11:10 pm on Dec 14, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks coops,
As I see it, the cavalry in last resort came to the rescue :)

coopster

11:12 pm on Dec 14, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Sure. For what it's worth, if you are not executing the file at all you shouldn't be overly concerned about copying it across the network. Save yourself the FTP step/process. Besides, if you are using FTP and not secure FTP ... are you not just opening another door anyway?

henry0

11:22 pm on Dec 14, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nope I used FTP as a general term
I use only SFTP, so happy with winSCP