Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using crontab along with mysqldump command to take my db backups once in 2 days.I need to download these files from the server to my pc..can i automate this download process too using some command??Please help me..Thanks in advance..

My pc is not using linux..

share|improve this question
    
Are we to assume both ends are Linux? –  John Gardeniers Aug 24 '09 at 7:42
add comment

4 Answers

up vote 2 down vote accepted

Since you mention crontab I assume we are talking about Linux-to-Linux boxes, then scp is what will work the best doing exactly what you want.

All you need to do is,

  • Figure out the commands to be run at every nth interval.

    e.g. #scp user@hostname:/path-to-srcfile/filename /destination-path/new-filename

  • Couple them in a neat shell file with logging enabled (directing the response messages/error to a log file)
  • Schedule it using crontab/at or your preferred scheduling tool

and you are done :-)

share|improve this answer
add comment

scp? rsync?

share|improve this answer
add comment

If both are linux boxes, you can have your ssh-key exchanged(but review security once) and thenembed scp+mysqldump in a small script and put the same in crontab in place currently existing single mysqldump.

Hope it helps..

Best Regards Debajit Kataki

share|improve this answer
add comment

Seeing that your PC is not linux, most of the advice given already will work, BUT ONLY if you create a share on your Windows box and mount that share on your server. Windows shares can be mounted with the CIFS type, like this

mount -t cifs //server/share /mountpoint credentials=filename

You will need to use the correct credentials, i.e. either a local user account or an AD user account on the PC. IF you use this on a regular basis, it's probably best to put the credentials in a small separate file.

Read more in the man pages for mount.cifs

Once you have mounted the share, follow the advice from Mohit Nanda to complete the job.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.