We help IT Professionals succeed at work.
Get Started

Powershell script to FTP recent files.

EdlenIT asked
Last Modified: 2012-05-11
Hello all,

I am extremely new to Powershell so any help would be greatly appreciated!  

Our SQL DB server is hosted.  I need to copy the .bak files for the SQL weekly backup, differential backup and transaction log backups to another offsite location via FTP.

The source folder is:

\\servername\c$\database backups\daily backups\
\\servername\c$\database backups\differtials\
\\servername\c$\database backups\translogs\

Because the full backups happen every Friday evening and are pruned every 3 weeks, I only want to copy the most recent Friday's backup.  I'd like the backup to run Saturday morning.

Because the diffs and the trn logs backups run constantly I'd like to also copy only the previous date's files.  I'd like to run these every morning between 12am and 2am.

Can someone please assist?

Thank you all in advance.
Watch Question
This problem has been solved!
Unlock 1 Answer and 1 Comment.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE