[Google]

Uploading website with lftp mirror

Remembering what files I’ve changed locally when fiddling with my website in order to upload them to my webhost can be quite hard for me. Sometimes I end up re-uploading large chunks of the site just to be sure I get everything uptodate. It should be a doddle since I have the local copy of the site in subversion, but working out how to ask svn what has changed since the last upload is quite hard, especially when I can’t remember when the last upload was :-) .

This should be the sort of thing the computer can work out for me with ease, look at what is already on the site and the local copy and only send the changes. Rsync for ftp is basically what I want, but I had to go through quite a few programs that claimed to do mirroring before I found one that worked properly (i.e. upload changed files only).

In the end I went with lftp and the script below, (I’ve removed the username, hostname and dirnames for security :-) )

open -u USERNAME FTPSITE
lcd LOCALDIR
cd REMOTEDIR
mirror –delete –only-newer –reverse –no-perms –exclude .svn –log=/var/log/mirror.log

Now I just have the problem of where to put the file, it doesn’t seem to fit in any categories I have dirs for. It’s not executable so it doesn’t belong in bin, it’s not really data do can’t go in any of the data dirs, it’s not a library. It’s driving me nuts. For the moment I’ve put it in share just to get it out of the root of home (I like to keep home free of everything but dirs and dotfiles).

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>