Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


FTP Sync Script?e

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,61396
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> FTP Sync Script?e
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 FTP Sync Script?e - 6/15/2008 11:04:05 PM   
  4scriptmoni


Posts: 208
Score: 0
Joined: 5/3/2007
Status: offline
Helo friends, anyone have ever wrote a script to Sync local folder to an FTP folder? Well I am about to, and any ideas or code is welcome...

I have tought of 2 basic approches:
'OPTION 1   ->>   get FTP files to local %tmp% and check date then overwrite to local if newer

'OPTION 2   ->>>   check FTP for new files if found download to sync folder, upload any not present files or local newer

I have this main code

      

< Message edited by 4scriptmoni -- 6/15/2008 11:06:39 PM >


_____________________________

Enterprise Microsoft Scripts
Exchange, Login/Logout Monitor,TS, Monitoring, Security, AD, etc...
http://www.felipeferreira.net
 
 
Post #: 1
 
 RE: FTP Sync Script - 6/17/2008 7:07:44 PM   
  4scriptmoni


Posts: 208
Score: 0
Joined: 5/3/2007
Status: offline
Nobody has never done such thing? I searched in google and found an activeX by Chilkat.Ftp2 but not even that worked for me...
this function ftp.SyncLocalTree did not work for me...

My code is still not working neither :(
The problem is

- Newer local files not been copied to FTP and getting replaced by servers'SyncFiles, not good anymore because when FTP files are downloaded they get new date!


any idea?

_____________________________

Enterprise Microsoft Scripts
Exchange, Login/Logout Monitor,TS, Monitoring, Security, AD, etc...
http://www.felipeferreira.net

(in reply to 4scriptmoni)
 
 
Post #: 2
 
 RE: FTP Sync Script - 6/17/2008 7:09:23 PM   
  Sirect

 

Posts: 25
Score: 0
Joined: 6/12/2008
Status: offline
Hash the Files then and If the Hash is not the same let it upload your local data...

(in reply to 4scriptmoni)
 
 
Post #: 3
 
 RE: FTP Sync Script - 6/18/2008 12:28:31 AM   
  dm_4ever


Posts: 2665
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
If you go along with Sirect's suggestion....this may help
http://www.microsoft.com/downloads/details.aspx?FamilyID=B3C93558-31B7-47E2-A663-7365C1686C08&displaylang=en

Also this is a free real basic FTP component:  http://www.sapien.com/download.aspx?file=ftp

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to Sirect)
 
 
Post #: 4
 
 RE: FTP Sync Script - 6/18/2008 2:11:17 PM   
  DiGiTAL.SkReAM


Posts: 1184
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
hehehh
I ran into the same issues.
My solution was to script a commandline interface for the freeware version of coreftp.
It contains a resume, etc. feature that can be utilized to perform a sync of folders.

but then, i'm lazy.

_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to dm_4ever)
 
 
Post #: 5
 
 RE: FTP Sync Script - 6/19/2008 6:03:08 PM   
  4scriptmoni


Posts: 208
Score: 0
Joined: 5/3/2007
Status: offline
If I do hash the file after downloading... How will I know witch one is newer and Witch one I should overwrite?
The idea is to sync with the newer file.

The Primalscript.FTPTransfer does not have a sync function does it? In the examples I only see download/upload.

THe only option I thought now was to parse a dir cmd inside FTP witch does diplay the something like:

"-rw-r--r--    1 xoroz    xoroz    15728640 Jun 19 18:44 small"

_____________________________

Enterprise Microsoft Scripts
Exchange, Login/Logout Monitor,TS, Monitoring, Security, AD, etc...
http://www.felipeferreira.net

(in reply to Sirect)
 
 
Post #: 6
 
 RE: FTP Sync Script - 6/19/2008 8:48:26 PM   
  4scriptmoni


Posts: 208
Score: 0
Joined: 5/3/2007
Status: offline
ok I was able to parse the ftp dir remote cmd, now I need to compare two values, I was thinking about using two dictonaries to verifiy first if files exists and compar date and time.

I have remote  FTP files output as:

small|19\06|18:44

And local sync folder files as:  

TS2.hta|06/06|19:38

Is it a good idea the dictonary? any help is welcome...

'Now I  have a dictonary of each side
'Compare that local files are also in remote if not upload and vice-versa but download
'then compare local files are newer then in remote if so upload and vice-versa but download
key:   small
Item: 19\06|18:44

small|19\06|18:44

< Message edited by 4scriptmoni -- 6/19/2008 9:48:08 PM >


_____________________________

Enterprise Microsoft Scripts
Exchange, Login/Logout Monitor,TS, Monitoring, Security, AD, etc...
http://www.felipeferreira.net

(in reply to 4scriptmoni)
 
 
Post #: 7
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> FTP Sync Script?e Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts