Solved

fileserver

Posted on 2004-04-13
9
257 Views
Last Modified: 2010-04-20
  My office have ftp sever how can i set ftp client to back up some folder automatic every day
Thank
0
Comment
Question by:teera
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 12

Accepted Solution

by:
stefan73 earned 250 total points
ID: 10813580
Hi teera,
Check "man .netrc" how to install some automatic FTP script.

You probably should use a two-stage cron script:

1. A script which creates the backup file

(like with:
find $HOME -type f -mtime -1 > ~/newfiles
tar -cf - --files-from ~/newfiles | bzip2 -9 > newfiles.tar.bz2
mv newfiles.tar.bz2 newfiles_ready.tar.bz2

Instead of $HOME you can use any other folder. bzip2 is very efficient, but also a bit slow. If speed is an issue, use gzip -1 instead.
)

2. An FTP script which simply uses "ftp backup", which will then use all the settings you defined in .netrc

-> This is still quite crude. There are better ways, such as using rsync via ssh. But you'll probably want a working solution first before refining it.


Cheers,
Stefan
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10817564
You can also use wget to retrieve the files from the ftp server. wget should be part of any major Linux distributions.
0
 
LVL 8

Assisted Solution

by:da99rmd
da99rmd earned 100 total points
ID: 10832717
Here is a easy sript based on  stefans code:

#!/bin/bash
tar -cf - (the name of the dir to backup) | bzip2 -9 > newfiles.tar.bz2 && mv newfiles.tar.bz2 newfiles_ready.tar.bz2 && ncftpput -u (username) -p (password) (remote-host) (remote-directory) newfiles_ready.tar.bz2
# End script

/Rob
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10832779
ncftpput is part of ncftp, which may not be installed automatically (or may not be part of your distribution at all).
0
 
LVL 8

Expert Comment

by:da99rmd
ID: 10832802
ncftp but its part of most distributions, and then how do you use wget to put files ?

/Rob
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10833099
You run wget from the machine that receives the files. If you need to put something on a ftp server, you need wput (which is a seperate project, and not part of most distributions).
0
 
LVL 12

Expert Comment

by:stefan73
ID: 10833108
>how do you use wget to put files ?

You could have the server "pull" them instead of the client "pushing" them. But you're right, this is probably less efficient.

The only reason to use this is security considerations. If the client is considered "unsafe", it's better to have the server get the file.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10833114
The question did not say which directions the files need to be moved. I just assumed that something on the server needs to be backed up. But you are right, it could be the other way as well.
0
 
LVL 8

Expert Comment

by:da99rmd
ID: 10833401
teera, plz give some more detailed information about what you mean.

/Rob
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question