LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 11-27-2003, 04:49 PM   #1
engnet
Member
 
Registered: May 2003
Posts: 30

Rep: Reputation: 15
Cronjob


Hello all, just a quicky.

Would it be possible and most importantly has anyone done it!! to run the following config.

Server 1 sat on internet with anon ftp area enabled.

Server 2 Dual Internet/Intranet server with samba enabled on internal nic/environment.

Ok here's my question, if someone uploads a file to server 1 could it possible at a scheduled time for the files added to be ftp'd as backup or sync to server 2.

And the same with server 2, files added via ftp or network/samba to be sync via ftp to server 1.

Am I missing something or just making life tooo complicated

Many Thanks

Chris
 
Old 11-27-2003, 05:58 PM   #2
gundelgauk
Member
 
Registered: Jul 2003
Distribution: Gentoo
Posts: 168

Rep: Reputation: 30
Greetings!


I must admit I don't know if it is at all possible to do what you want to do via ftp. The problem is you always have an authentication process (ie. login/password prompt) with ftp, which to my knowledge cannot be made entirely automated. But maybe you can achieve what you want using NFS. For example you can share the ftp-upload-directory of server1 and mount it as an NFS volume on server2. You could then add a cron job on server2 which copies the files from that mounted NFS volume to a local disk of server2 in order to have a backup. Also files copied to server2 via Samba could be copied/synced to server1 via this NFS share by a cron job.

Of course you have to consider the security implications of using NFS. As I have never used NFS myself, I can only give you that much advice but I'm sure there are plenty of ppl who can give you more advice about its possibilities/risks. The great advantage with NFS is imho that it adds a directory on another box to your local file system transparently (like mounting a cdrom or a samba share) which makes it much easier to accomplish certain tasks via simple shell scripts (which can in turn be called by cron).


Good luck!
 
Old 11-28-2003, 10:15 AM   #3
engnet
Member
 
Registered: May 2003
Posts: 30

Original Poster
Rep: Reputation: 15
thanku

Many thanks, only problem with NFS is the location of the servers:

Server 1 - Burstnet Network USA

Server 2 - External/Internal Network UK

I think I would need to configure a VPN between servers. This is what I was trying to avoid.

Cheers

Chris
 
Old 11-28-2003, 01:15 PM   #4
JordanH
Member
 
Registered: Oct 2003
Location: Toronto, Canada
Distribution: Ubuntu, FC3, RHEL 3-4 AS Retired: SuSE 9.1 Pro, RedHat 6-9, FC1-2
Posts: 360

Rep: Reputation: 30
It would be possible to ftp from server 1 to server 2 automatically. However, FTP isn't the most secure protocol.

Think about this...
1. tar/zip source files on source server
2. ncftp tar/zipped source server to target server

You could then run this as a cron job hourly or nightly or whatever.

This is not a good solution for several reasons.
1. ftp is not secure.
2. You are possibly transferring tonnes of data hourly/nightly/daily.
3. If files are only partly uploaded, your data will not be complete on the other side. i.e. user has uploaded 50% of fileA then you zip/tar and send it from server 1 to server 2.... user on server tries to access FileA and the file will look corrupt! d'oh, only 50% is there.

If this is for backup, it might be more cost efficient to have backup procedures in each location.

If you insist on the above... read up on ssh.
 
Old 11-28-2003, 01:27 PM   #5
JordanH
Member
 
Registered: Oct 2003
Location: Toronto, Canada
Distribution: Ubuntu, FC3, RHEL 3-4 AS Retired: SuSE 9.1 Pro, RedHat 6-9, FC1-2
Posts: 360

Rep: Reputation: 30
command for ncftp is this...
ncftpput -u $username -p $password $ftpserver $remote_directory $sourcefile

($remote_directory can be ./ )

#!/bin/bash
# Example script, please this in your cron.daily directory to ftp home backups.
tar -cfz /tmp/source.tar /home/
ncftpput -u bob -p SecurePassword ftp.ukserver.com ./ /tmp/source.tar
 
Old 11-28-2003, 02:38 PM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 65
If you don't want to transfer every file each time you could try using ftpfs to mount ftp server 1 on server 2 then run rsync to mirror them. I've not tried it but I think it should work. I use ftpcopy to do this myself but AFAIK it can't upload files so you would need to run it at each end.
 
Old 03-03-2004, 10:21 AM   #7
ugob
Member
 
Registered: Nov 2003
Distribution: RH, Fedora, Debian, Knoppix
Posts: 436

Rep: Reputation: 31
Maybe use rsync?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cronjob problem chadi Linux - General 5 10-10-2004 10:09 PM
cronjob help meeh Linux - General 1 03-26-2004 12:41 PM
cronjob ugob Linux - Software 0 03-03-2004 10:20 AM
Su in a cronjob michedlp Programming 3 11-06-2003 09:30 AM
cronjob FastEddy Linux - General 1 04-12-2003 10:52 PM


All times are GMT -5. The time now is 04:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration