Working with a slow connection - ftp

I'm working with Textmate and Transmit.
I work locally and sync with the server every now and then.
At the moment I'm doing this by myself, it's slow and takes some time.
What are the best ways to sync between servers?
Also, is it possible to archive the directory and unpack it at the server? This would be so much faster...
Thanks!

What are the best ways to sync between
servers?
rsync? It's pretty much designed to do that exact task (syncing changes between files) and comes standard on most *nix OSes (including Mac OS X).

If you have, or could obtain, ssh access you could use something like SSHFS with MacFUSE
This would let you remote mount the server filesystem though Finder, as if it were local, but only using a ssh secure shell remote login.

Option 1
rsync --help
Option 2
Get an editor which is able to work with remote files.
Option 3
Mount remote directory and use your favorite editor.

Yummy FTP is for Mac and much faster than Transmit. It's the best you can get if you have only a FTP connection.

Related

Is there an efficient way to do remote editing over server using sublime Text 3?

I am writing some projects and need frequently compile and test on remote machine.
I am not a vim user thou :(
What I end up now is to use Fetch to browse the project folder and directly open those file using sublime by changing the default editor in Fetch. It somehow works, but one thing not perfect is that I cannot have a “project” structure in my sublime.
I am wondering anyone has a better way to use Terminal (or iTerm whatsoever) with sublime better.
Although this question is over two years old, I will try to answer it. Maybe it will be helpful for you or others that find it.
First, there is sshfs, which you can install via Homebrew or MacPorts. A simple approach would be as following:
mkdir -p ~/mnt/server
sshfs user#server.example.com:/path/on/server ~/mnt/server
Afterwards, you have the complete folder structure from server.example.com locally available at ~/mnt/server. Make sure you set up SSH keys to avoid entering the user password every time. You can find tutorials on that everywhere on the net.
For servers that only offer FTP access (shared hosting and the like), you can use curlftpfs in the same fashion.
To close the connection, simply unmount:
umount ~/mnt
For a GUI-based approach, you have several options. There is Transmit, which features mounting connections as volumes, Forklift which is a Finder replacement that can do the same, ExpanDrive and my favorite Mountain Duck.
If you plan to move lots of data, especially a lot of small files, Mountain Duck performs the best in my testing.
You could use TransmitFTP. Any FTP/SFTP/WebDAV/S3 server connection can be mounted as a volume, e.g., /Volumes/Example. Then you can browse to it when opening a folder in SB and add to your project like any other directory on your filesystem.

Moving files across a computers connected by LAN

I am needed to move entire directories from one computer in the network to the other (In a platform independent way). Basically I am working on some automation tool to help the developers do Build Verification Tests, for this; I am directed to automate the installation and un-installation of the product on multiple platforms. So, I will need to first copy the files!
And this is where I needed some help in both conceptual and practical knowledge.
Firstly, let me mention that using something like FileZilla or WinSCP is out of the question since I need things to happen automatically and not through button clicks. But please let me know if these tools have any command line utilities!
I tried Perl's NET::FTP, and while it looked promising, I was wondering whether it was the best way to go. Also, I want to know what are the pre-requisites before I can run FTP, I mean would I need perl installed on the other end as well ? I constantly read that the commands from perl's FTP actually try to connect to a FTP host, does this mean its not going to work if I haven't configured the remote host in some way? And if I am right, then what is this extra piece of configuration to be done?
Apart from this, is there any other way I could solve my problem ? I mean I am looking for API's here that would help me do platform independent file transfers. But once again, I cannot use tools that would need button clicks and stuff, because I am doing automation and everything needs be dome programmatic-ally and automatically.
Also, I think this is a very generic problem-statement: "Moving files across a computers connected by LAN"; So, it would be wonderful if we can have a list of (possibly) many options (ways to solve the problem) in the form of answers to this post.
Thanks in advance for any help that you wish to provide.
If nearly all of the files in your directory have changed, creating an archive, sending it over the network, and unarchiving makes sense. Actually, if your LAN is fast enough, though, it may be faster not to compress the archive--just use tar.
If only some of the files have changed, rsync, a command line tool, will only download the changes. It can be used with ssh like this:
rsync -ae ssh username#hostname:/path/to/files /store/here/locally
http://www.thegeekstuff.com/2010/09/rsync-command-examples/
On Linux and OS X, cron and crontab allow you to schedule scripts to run periodically. Windows provides the Windows Task Scheduler.
FTP is fine if you don't care about encryption over your LAN. Otherwise, SSH would be preferable.
rsync is available on OS X and Linux, but I think you can use it on Windows through Cygwin.
I suggest making an archive (e.g. a .tar.gz file) on the source host, transferring it with scp, and unarchive it on the target host.
You could also use unison or rsync
I would suggest you to develop your own FTP client in .NET. This way you will have complete control over the application, and instead of button-clicks you can schedule it using windows-scheduler. Here is an article about how to create your own FTP client in VB.NET:
http://dot-net-talk.blogspot.com/2008/12/how-to-create-ftp-client-in-vbnet.html

Textmate question: how to have a drawer when editing files online?

is it possible with Textmate to work remotely and using the sidebar drawer?
thanks
How do you do the "remote" part of your question? SSHFS? FTP?
If you use FTP (Transmit or Cyberduck) there is at least one way but I think it's extremelly convoluted. I used to want it badly when I started to use TextMate but I soon learned about Subversion and then Git and now, I almost never use an FTP client for development work at all.
Both versioning systems are extremelly well integrated with TextMate and the whole concept of working on a local copy and pushing only valid changes is vastly superior to using an FTP client to download a whole file in a temp folder, opening it with a local editor, saving the temp file, uploading it to the server.
If you use SSHFS or some other ways to mount the remote server you can use it as you were working with local file with the caveat that the whole thing can be maddening slow.
Did you try to edit the files within an SSH session in the terminal? Using Vim like that is actually very fast but it can lead to somewhat unpleasing situations when not done correctly.
I found myself:
Use Transmit 4+
Mount the server as image
drag the entire mount icon in textmate
done.

Best way to edit Linux server configuration files on Mac OS X?

I'm used to editing my remote Ubuntu server through SSH and Nano. I've tried using Vim and Emacs but since I don't manage the server frequently enough I never quite get the hang of it and end up forgetting the commands.
I use TextMate daily for programming and was wondering if there's any counter-recommendation against mounting the server's /etc/ folder locally using http://www.macfusionapp.org/ and creating a TextMate project containing /etc/ and editing all configuration files right within?
root would have to be used through SSH to allow editing of the /etc/ files so that makes me a little nervous. Is this a bad approach?
I sometimes use Cyberduck to remotely edit files. You can set up SFTP connections in Cyberduck, so you can connect to any remote machine to which you have SSH access. Cyberduck lets you use TextMate as an external editor, so you can set up the connection and start editing, and Cyberduck will automatically upload your changes.
(This is probably possible in other FTP clients like Transmission, too, but I personally use Cyberduck so I don't know much about other clients.)
There's nothing wrong with using MacFUSE, but I find the Cyberduck solution to be simpler.

Upload to ftp on change

I like the functionality of dreamweaver where you can add a site and define an ftp and then when you save a file it saves a local copy and also uploads a file via ftp. I am trying to get similar functionality with linux. What I have thought of doing is have inotify monitor a local folder and upload any new or changed files to an ftp site, but I am having a hard time finding information on this. Any ideas on how I can accomplish this?
Also, I do not want to install any programs on the ftp server.
Thanks
Dean
You might want to take a look at cron scheduling an rsync job, which will efficiently copy changed files across a network at a chosen interval. rsync will use ssh or rsh (not ftp), so this might not work, but would seem a better way in most cases.
I'd throw together a python script which uses inotify and scp/ftp.
These are all common and should be supported by whatever distro your using. They're also all pretty well documented.

Resources