Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Tech198

Cancelled
Original poster
Mar 21, 2011
15,915
2,151
I'm looking for an automated way via Apple script to grab all files from local drive in particually directory (or root to scan all sub folders and files inside) and compare this 'list''to remote ftp and update local files when filenames don't match..

i.e replace _ with a <space> or ' hyphen when needed.

is this easy to do?
I'm not shooing in the dark, the script would make a listing all all folders and files on local dive first so it has something to with..

I was thinkng along the lines of:-

- mount ftp volume on ddesktop
- get list of every folder and file on local drive
- read list and check to see if filename and sizes both match to remote.
- if differences exist, update local drive

move onto next file and repeat..

is Applescript a good choice for this or should i be using software instead, like Beyond Compare for Windows ?

I do know you can use 'diff' on Mac to compare two files, so i would think it would also work for remote as well in script (or similar command)

I've been previously manually renaming and to speed it all up, i've been batch renaming in Finder "Select say 100 files and rename all replacing _ with & etc'

but its time consuming.. looking for alternatives.
 

2984839

Cancelled
Apr 19, 2014
2,114
2,239
I'd look into rsync. It is very similar to what you're trying to do and the messy details are already handled for you. You can throw a shell script together to handle the rest.

What are you trying to accomplish with this? Just change the filenames on the local drive when they change on the remote server, or do you want the actual file itself to be pulled down from the FTP server?
 

Tech198

Cancelled
Original poster
Mar 21, 2011
15,915
2,151
Just change file name of local to match remote..

ok, i'll look into rsync.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.