Solved

fileserver

Posted on 2004-04-13
9
253 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
  • 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
 
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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
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.

919 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now