How to check if the file exists in S3 bucket

Welcome Forums General PowerShell Q&A How to check if the file exists in S3 bucket

  • This topic is empty.
Viewing 0 reply threads
  • Author
    Posts
    • #254912
      Participant
      Topics: 12
      Replies: 17
      Points: 56
      Rank: Member

      Hi,

      I am trying to build a script to copy sql backups to an S3 bucket. The structure of the folders is like this:

      ServerName

      – FullBackups

      — Daily

      — Weekly

      — Monthly

      Inside the lower level folders are the backups. But the structure may change. I have a script below which recursively looks through the folders and copies the backups.

      One problem though. If the file exists in S3 it gets copied again. How can I add a check to see if the file is there already and skip copying if the case. I need something like this:

      This is is the main script:

Viewing 0 reply threads
  • You must be logged in to reply to this topic.