Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> rsync help
McKettle
post Jun 21 2012, 10:09 AM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 5
Joined: 21-June 12
Member No.: 17,673



Hello,

I'm hoping someone can help and that I have not posted this in the wrong place.

A client of ours requires a backup of their mySQL database done each night. At the moment a mysqldump is run on the server and e-mailed to us, we then ftp the compressed dump to another server. Recently the dump has exceeded our e-mail quota so now we just receive a link to the file. Asking around we were told about rsync so we could cron a rsync job to copy the dump to the other server automatically. I have been testing this and trying to get it to work but I can't manage it. This is what I have been trying.

rsync -zvr /(source) (Username)@(Address):/(destination) password:(password)

I SSH into our server and run the command and get the following error message

Unexpected remote arg: (Username)@(Address):/(destination)
rsync error: syntax or usage error (code 1) at main.c(1213) [sender=3.0.6]

As you may tell from above I am relatively new to linux so please be gentle with me regarding any terminology I have used incorrectly.

Thank you in advance.
Go to the top of the page
 
+Quote Post
michaelk
post Jun 21 2012, 05:56 PM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,797
Joined: 23-January 03
Member No.: 360



It appears that you are trying to run rsync over ssh. Check out the link below. Does the provided link include the file name or just the folder?
If it contains the name then you can use scp or use a ssh file browser like filezilla, nautilus or konqueror.
,
/www.cyberciti.biz/tips/linux-use-rsync-transfer-mirror-files-directories.html
Go to the top of the page
 
+Quote Post
McKettle
post Jun 22 2012, 06:03 AM
Post #3


Whats this Lie-nix Thing?
*

Group: Members
Posts: 5
Joined: 21-June 12
Member No.: 17,673



Hi,

It is for the whole folder not just one file. I can only connect into the backend of our the server via SSH.

I have gone through the site you linked and tried some of their examples but I get the same errors
Go to the top of the page
 
+Quote Post
michaelk
post Jun 22 2012, 06:44 AM
Post #4


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,797
Joined: 23-January 03
Member No.: 360



Then how do you connect to the server with the mysql dump?
Go to the top of the page
 
+Quote Post
McKettle
post Jun 26 2012, 07:58 AM
Post #5


Whats this Lie-nix Thing?
*

Group: Members
Posts: 5
Joined: 21-June 12
Member No.: 17,673



I have just found out that I have given you the wrong info.

It is just one file that needs to be copied not the whole folder.

We can access the servers via both SSH and FTP.

There is a script in place on the server already that runs the dump, I just need to either add another script to move that dump to another server.
Go to the top of the page
 
+Quote Post
michaelk
post Jun 26 2012, 04:09 PM
Post #6


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,797
Joined: 23-January 03
Member No.: 360



scp would be the most secure with public/private keys. If not then you can write an expect script but if you hard code the password save it with limited permissions.
Using ftp with expect would also work but since the passwords are sent as clear text I would only use it as a last resort.
Go to the top of the page
 
+Quote Post
McKettle
post Jul 9 2012, 08:14 AM
Post #7


Whats this Lie-nix Thing?
*

Group: Members
Posts: 5
Joined: 21-June 12
Member No.: 17,673



Really sorry for the delay in getting back to you on this.

I know you said it's the least safe... but what would the script be to FTP it to the other server?

Thank you
Go to the top of the page
 
+Quote Post
McKettle
post Jul 9 2012, 08:29 AM
Post #8


Whats this Lie-nix Thing?
*

Group: Members
Posts: 5
Joined: 21-June 12
Member No.: 17,673



Just found this, so will give it a go.


#!/usr/bin/expect
spawn ftp ftp.remotedomain.com
expect "Name (ftp.remotedomain:root):"
send "username\r" //provide the username here
expect "Password:"
send "password\r" //provide the password here
expect "ftp>"
send "lcd /var/log/httpd\r" //any desired location
expect "ftp>"
send "put *.acslog\r" //any file
expect "ftp>"
send "bye\r"
#interact
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 21st October 2017 - 09:05 AM