Terminal: Extract zip

I’ve successfully been using the Terminal to merge updated CMS files on the Desktop to the local dev install using the ditto command:

ditto /Users/Home/Desktop/modx-2.2.5-pl /Users/Home/Documents/Dev/site/

But when it comes to merging the same files with ditto to the remote server (connected via SSH) it fails with the Terminal returning “command not found”.

ditto /Users/Home/Desktop/modx-2.2.5-pl /www/public_html/

So instead I’ve been using FTP Merge (an alternative option in the CMS docs) to move the updated files. It’s been suggested that using ftp merge may sometimes miss files and therefore cause problems (which I’m experiencing) and is why the command line is preferred.

Is the problem that the updated files (delivered as a zip) must first be uploaded to the server then extract the zip with the Terminal? Could it be that simple?

Todd


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I would try rsync or scp – I’ve not tried ditto. rsync is very much like Freeway’s smart upload; only sending files that have changed. As far as uploading a zip, you have to do something on the server you have uploaded it to that bursts it apart into its component files. More than likely, you would also need to move the files, since there’s often an implicit archive wrapper around a zipped collection of files. Unzipping the archive in place may give you /archive/*files rather than *files.

Walter


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I would try rsync or scp – I’ve not tried ditto.

Would I just replace ditto with rsync or is the syntax completely different?

rsync /Users/Home/Desktop/modx-2.2.5-pl /Users/Home/Documents/Dev/site

dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

rsync -avz /path/to/local/folder/ email@hidden:/path/to/remote/folder/

man rsync for an explanation of all the various flags. These are the basics to preserve all permissions and ownership when copying, and to show a running list of what’s going on (the usual meaning of -v).

Walter

On Oct 27, 2012, at 12:33 PM, Todd wrote:

I would try rsync or scp – I’ve not tried ditto.

Would I just replace ditto with rsync or is the syntax completely different?

rsync /Users/Home/Desktop/modx-2.2.5-pl /Users/Home/Documents/Dev/site

dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks. There must be something hinky with my Terminal SSH connection because it doesn’t work.

Todd

rsync -avz /path/to/local/folder/ email@hidden:/path/to/remote/folder/

dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

What sort of error do you see? Does the folder exist at both ends, and does your current user have access to the local folder and your remote user have access to the foreign folder?

Walter

On Oct 27, 2012, at 2:59 PM, Todd wrote:

Thanks. There must be something hinky with my Terminal SSH connection because it doesn’t work.

Todd

rsync -avz /path/to/local/folder/ email@hidden:/path/to/remote/folder/

dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I’m sending the Terminal error separately since it contains account-sensitive info.

Yes to everything else you asked below. I’m trying to move the contents of “Folder A” on the Desktop to the public_html directory. There is a RSA host key warning (see private email).

Todd

What sort of error do you see? Does the folder exist at both ends, and does your current user have access to the local folder and your remote user have access to the foreign folder?


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options