I was referring to an "unzip" option.
Quote:
[-d exdir]
An optional directory to which to extract files. By default, all files and subdirectories are recreated in the current directory; the -d option allows extraction in an arbitrary directory (always assuming one has permission to write to the directory). This option need not appear at the end of the command line; it is also accepted before the zipfile specification (with the normal options), immediately after the zipfile specification, or between the file(s) and the -x option. The option and directory may be concatenated without any white space between them, but note that this may cause normal shell behavior to be suppressed. In particular, ``-d ~'' (tilde) is expanded by Unix C shells into the name of the user's home directory, but ``-d~'' is treated as a literal subdirectory ``~'' of the current directory.
|
If both locations use Linux, you might want to use tar instead.
I'm not familiar with that ftp program, but there is something I discovered about the ftp command in Linux. At work we changed from Seachange to Adtec ad insertion equipment. All of the spots in the old video library server had to be converted to MPEGs and send to each of the new adtec racks. They use the ftp protocol to transfer files. I was able to take a directory listing of a large number of mpeg files and using sed, I converted the directory listing to an ftp script. The script would connect to the units like this:
ftp username:password@10.10.10.10 < script.ftp
The ftp command would connect with the username and password and would execute the commands in the script "script.ftp". The last command in the ftp script was "bye" so that it would then disconnect and connect to the next rack.
You could have a cron job similar to this:
ftp -i user:password@officeb_ip/path_to_directoryB/ << BYE
mput *.tar.gz
bye
BYE
This script uses a "here" document instead of redirecting input from a script. Instead of reading in lines from a file, the lines are read in from the same script until a line ends in the terminator, which is BYE in this case. The bashref manual would have more details on this.
If the offices are connected via a vpn, you wouldn't even need to bother with all of this. A user in office A could just drop the files into a shared folder. Making a directory write only for "others" would make the directory a Drop Box.
If you don't have a VPN, consider using sftp instead of ftp. The traffic over the net will be take place through an ssh tunnel.
There are other programs to consider, such as curl, wget, rsync.
Good Luck!