Solved

fileserver

Posted on 2004-04-13
9
254 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

816 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

9 Experts available now in Live!

Get 1:1 Help Now