Link to home
Start Free TrialLog in
Avatar of Zahid Ahamed
Zahid AhamedFlag for United States of America

asked on

Download SQL backup .bak file to local folder from FTP site

Hi,

I have a requirement daily database refresh at 4.00 am and i schedule this job, now need to download .bak file from ftp site daily basis so that SQL job can restore the .bak file from local drive.

Please help!
Avatar of HainKurt
HainKurt
Flag of Canada image

backup as

MYDB_YYYYMMDD.bak

How to rename a backup file with date suffix?
http://www.sqlusa.com/bestpractices2005/renamebackupfile/
Avatar of Qlemo
You can use a simple FTP script, as long as there is either only a single file found, or the file is named the same all the time.
@echo off
(
  echo open x.x.x.x
  echo Username
  echo Pwd
  echo cd \folder1\folder2
  echo lcd \targetfolder
  mget *
) | ftp -n -i

Open in new window

You'll have to replace the placeholders in each line, of course.
I use SQLBackupAndFTP. If I understand your requirement correctly, it will work for it.
https://sqlbackupandftp.com/features
Avatar of Zahid Ahamed

ASKER

Didn't work, Because this requires SSL connection. How do i automate downloading files using winscp?
dont use ftp, use any other clients listed here which supports command line and SSL

Overview of SFTP, FTPS, SCP and FTP
http://geekswithblogs.net/bvamsi/archive/2006/03/23/73147.aspx
ASKER CERTIFIED SOLUTION
Avatar of Zahid Ahamed
Zahid Ahamed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I have done this myself