Zahid Ahamed
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!
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!
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
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
https://sqlbackupandftp.com/features
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
Overview of SFTP, FTPS, SCP and FTP
http://geekswithblogs.net/bvamsi/archive/2006/03/23/73147.aspx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have done this myself
MYDB_YYYYMMDD.bak
How to rename a backup file with date suffix?
http://www.sqlusa.com/bestpractices2005/renamebackupfile/