0

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..

1
  • Are we to assume both ends are Linux? Aug 24, 2009 at 7:42

4 Answers 4

2

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 :-)

1

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.

0

scp? rsync?

0

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

You must log in to answer this question.