Tricks and Tips about Systems/Network

February 18, 2010

How do I syncronize the FTP files/ incremental FTP backup

Filed under: admins,FTP — Liju Mathew @ 5:00 pm

I want to backup all the files on the live server to keep on my backup server. How I can do this ?

I prefer lftp to do this. Using lftp we can either synchronize the local files to a remote location or wise versa.

1. How do I syncronise the a folder on a FTP location to my local Linux server.

Suppose these are my remote ftp details:
FTP : 208.74.34.93
User: user
Password : pass
Ftp backup folder: securedata

[root@web-test1 ~]# yum install lftp*

Then

#lftp -u user,pass -e "mirror --delete --only-newer --verbose /securedata /Backup/local/webfiles" 208.74.34.93</code>

I simply create script file and add this to a daily cron job,

[root@rc-040 scripts]# crontab -l
10 12 * * * /bin/sh /home/installation/scripts/marketbkp.sh

Second one is, copying the local files and upload to a remote ftp location. Just append the word "--reverse" to the existing command line path.

#lftp -u user,pass -e "mirror --reverse --delete --only-newer --verbose /securedata /Backup/local/webfiles" 208.74.34.93

Which would upload/synchronize all the files from the locally and upload to the remote location. This would be very helpful in case of disaster management. I do create a script for this.

December 22, 2009

VSFTPD – How to change the annonymous FTP path

Filed under: admins,FTP,Linux — Liju Mathew @ 9:17 am

Question.
How do I change the anonymous FTP path ?

Answer.
1. edit

[root@rc-025 ~]# vi /etc/vsftpd/vsftpd.conf

2. add the following line which point out the anonymous ftp location

anon_root=/backup/shares/

3. restart VSFTP service

/etc/init.d/vsftpd restart or service vsftpd restart

Advanced security

If you want to limit ftp users access only to his/her home directory, then add the following lines to the vsftpd.conf file.
chroot_local_user=YES

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.