Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Nov 2000 02:36:42 -0600
From:      Ben Weaver <sid67@tranquility.net>
To:        david@banning.com
Cc:        questions@FreeBSD.ORG
Subject:   Re: automatic ftp put
Message-ID:  <20001127023642.A97243@tranquility.net>
In-Reply-To: <200011270648.BAA01730@d.tracker>; from david@www3.pacific-pages.com on Mon, Nov 27, 2000 at 01:48:18AM -0500
References:  <200011270648.BAA01730@d.tracker>

next in thread | previous in thread | raw e-mail | index | archive | help
I wanted to do the same thing with a site I was working on and updating frequently.  Here's what I threw together:

On my workstation I have a shell script called syncronize.  Here it is:

#!/bin/sh
tar cvzf - directory_to_publish | ssh username@server ./server_sync

Keep in mind for this to work, the directory_to_publish must be a subdirectory of the directory syncronize is in.  You can change this as you like by altering the tar flags.

On the server I made a shell script in my home directory called server_sync:

#!/bin/sh
dd of=tmp.tar.gz
rm -R /path/to/website/root/directory/*
tar xvzf tmp.tar.gz -C /path/to/website/root/directory/
rm tmp.tar.gz

That's about it...  It's pretty crude, but it works for what I need it to do.

-Ben

On Mon, Nov 27, 2000 at 01:48:18AM -0500, David Banning wrote:
> I am trying to update my website automatically, but
> as far as I can see, there is no way to use ftp from a script.
> 
> Am am now looking at ssh/scp but I find it confusing.
> 
> Can anyone suggest how I can do what I want?
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
> 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001127023642.A97243>