Results 1 to 10 of 12
Hi,
I got a Suse 10.1 server and a 50gb remote ftp backup space.
What I need a is a shell script that will sync my home folder and it's ...
- 06-04-2007 #1Just Joined!
- Join Date
- Jun 2007
- Posts
- 8
Need a simple sync via FTP shell script
Hi,
I got a Suse 10.1 server and a 50gb remote ftp backup space.
What I need a is a shell script that will sync my home folder and it's sub directories while excluding some directories (due to size) to that remote FTP.
Anyone has such a shell script he/she can share?
Thanks!
- 06-04-2007 #2Just Joined!
- Join Date
- Apr 2007
- Posts
- 13
Install lftp and create a cron job that looks something like this:
Then create the /<path>/<to>/list.x file to look something like this:Code:0 15 * * 0-5 lftp -f /<path>/<to>/list.x
Code:open sftp://<username>:<password>@<ip address> mirror -c /<path to source on remote host> /<path to destination on local host> exit
- 06-04-2007 #3Just Joined!
- Join Date
- Jun 2007
- Posts
- 8
Thanks
So if I get it right the source folder is my server and the destination one is the backup ftp server?
Also - will this run recursively on the sub folders?
and how do I exclude some of the sub folders?
And another "stupid question": if my ftp password contains "@" in it. How do I pu that in the ftp connection string so that the server knows it's part of the password?
- 06-04-2007 #4Just Joined!
- Join Date
- Apr 2007
- Posts
- 13
Yes source directory is the server to be backed up and destination is the server to which you are backing up. The script runs on the latter.
It will mirror the directories recursively yes.
You can exclude files using the -x or -X option. check the man page for syntax...it will even take regular expressions or globs.
Not to sure about the @ question though....uhm maybe try and play around with masking it with a backslash like this:
p\@ssword
Or else try and use single qoutes 'p@ssword' (hope that's not really your password
Third option is to change your password....will probably be the quickest.
- 06-04-2007 #5Just Joined!
- Join Date
- Jun 2007
- Posts
- 8
Thanks
Thanks Jis,
Well I can't change the pwd as it's 3rd party assigned.
I also can't run the script on the target destination server as it's a nas shared backup one. I can only run it on my own machine (source).
Will that work?
Also - where and how can I install lftp on Suse?
- 06-04-2007 #6Just Joined!
- Join Date
- Apr 2007
- Posts
- 13
Yes it should work either way around but I think your password might be a bit of a challenge. Have you looked at rsync? You can run it through an SSH tunnel so it will synch local and remote directories securely.
You can install lft from the SuSE CD's using YAST
- 06-04-2007 #7Just Joined!
- Join Date
- Jun 2007
- Posts
- 8
Hi,
Yeh - I've asked the backup owners and they don't support RSH so no rsync
About the lftp - I'll give it a try now - thanks!
- 06-04-2007 #8Just Joined!
- Join Date
- Apr 2007
- Posts
- 13
They Shouldn't support RSH! it is insecure. You will need SSH .
- 06-04-2007 #9Just Joined!
- Join Date
- Jun 2007
- Posts
- 8
Found it - thanks
- 06-06-2007 #10Just Joined!
- Join Date
- Jun 2007
- Posts
- 8
Ok,
Need some help.
I got a cron doing:
lftp -f /mirror.x
Then the mirror.x file:
open ftp://myuser:mypass@mybackupftp_ip
mirror -c / --exclude /var/www/vhosts/Mysite.com/httpdocs/files
exit
It just doesn't copy a thing.
If I take out the exclude it works but doesn't exclude.
I tried with -x and also changing the position of the / in the command with no change.
(I want to backup all BUT the that folder specified above).
Any ideas?


