[X-Unix] Setting up an SFTP server? Or possibly an SSH option?

Sharninder sharninder_khera at symantec.com
Mon Aug 29 22:20:27 PDT 2005


On Tue, 2005-08-30 at 00:02 -0500, Rad Craig wrote:
> On Aug 30, 2005, at 12:00 AM, Sharninder wrote:
> 
> > On Mon, 2005-08-29 at 23:10 -0500, Rad Craig wrote:
> >
> >> I am trying to setup an SFTP server to download copies of our website
> >> backups.  We make a full backup once a week, just over 2GB right now.
> >>
> >> My webhost builds the backup archive and will send it to a remote  
> >> FTP/
> >> SFTP server.  I need to do this because when I make a backup, it
> >> nearly pushes me over our quota on the website and makes my mail
> >> server act up.  I have to use SFTP because of the 2GB limit of FTP.
> >>
> >> I would also be open to using SSH and some form of secure copy.  I
> >> know very little about UNIX, so I'm looking for some help.  It
> >> doesn't have to be completely automated, but that would be very nice,
> >> to write a script.  I have SSH access to my web host.
> >>
> >>
> >
> > I'm not sure if I understand your problem correctly, but you can  
> > set up
> > a cron job on your webhost to scp the backup file (I'm assuming  
> > that its
> > just a tar.gz file) to your OSX box:
> >
> > man crontab;crontab -e
> 
> Yes, its a tar.gz file.  I'm just looking for a solution to get the  
> backup file from my webhost to my local OSX machine, just for  
> safety.  I keep 6 weeks worth.  I don't really care if its via SCP or  
> SFTP, I just want something that works.  SCP would probably be  
> better.  Wouldn't it copy it as the archive is created, so that it  
> doesn't have to build the entire 2GB archive before it starts to copy?
> 

I don't think it would be possible to copy the archive as its created,
not without some fancy scripting, which both of us might not want to get
into ;)

> I'll lookup the crontab stuff.
> 
> >

Yes. cron is what you need for your job. Just set a cron job a few
minutes/hourse after the webhost starts its backup.

> >
> > And use a variant of the below command to tranfer the files to your  
> > OSX
> > box:
> >
> > scp backup.tar.gz user at osxbox:/backups
> 
> I think I understand that.
> 
> scp is the command, backup.tar.gz is the backup file, then user at host  
> (my local machine)/local directory.
> 

Yes. Brilliant :)

> >
> > You'll have to keep ssh running on your OSX box, though. You can  
> > find it
> > under system preferences->sharing
> 
> Or I could turn it off and on depending on when I copy this backup  
> file.  It would be nice to setup a cron job on my OSX box to turn  
> that off and on so that I don't have to leave it running all the time.
> 

Yes you can run a cronjob on your OSX box also to start and stop ssh.
Basically, stop ssh from the system preferences and instead setup a cron
job to start ssh (sshd) and stop it after a few minutes. The problem is
that you will have to guess how much time the download of the backups
would take. Its much better to anyway have ssh running all the time. It
does'nt use too much resources.


> Thanks for the input.
> 

My pleasure.

--
Sharninder




More information about the X-Unix mailing list