Skip to main content
Solved

Set a file list for backup in before job script


Hi,

I need to write to the tape files created during previous day. I have a script which generates that list. How can I tell Veeam, which files to write?

Do I need to write script creating a new job each day or it is possible to use β€œbefore job script” for that?

Thanks in advance

 

Best answer by regnor

For an existing file to tape job its possible to set the file selection with a powershell script. It's been a while since I've used it, so I cannot guarantee that it still works. And I'm not at my computer so formatting may not look that good.

 

$files = ListofFiles

#Generate "FiletoTape"-Objects
$filestotape = foreach($f in $files){New-VBRFileToTapeObject -Path $f.fullname -Server (Get-VBRServer -name VBRServer) -ErrorVariable +vbrerror}


#Replace Objects in File to tape job
Get-VBRTapeJob -name JobName -ErrorVariable +vbrerror | Set-VBRFileToTapeJob -Object $filestotape -ErrorVariable +vbrerror

 

View original
Did this topic help you find an answer to your question?

10 comments

Chris.Childerhose
Forum|alt.badge.img+21

If the files are placed in a location you can use a file to tape job to back up a directory with the files or set up a job to copy the files to the folder for backup.

https://helpcenter.veeam.com/docs/backup/vsphere/file_to_tape_jobs.html?ver=120

 


JMeixner
Forum|alt.badge.img+17
  • On the path to Greatness
  • 2650 comments
  • March 4, 2023

Do you have to pick some files gebrated during the day or do you vackup all files geberated during the day.

If you want to backup all new files, the File to tape jobs do incremental backups, too. Configure the job to look at at all directories the generated files are in and you should be fine.


regnor
Forum|alt.badge.img+14
  • Veeam MVP
  • 1354 comments
  • Answer
  • March 4, 2023

For an existing file to tape job its possible to set the file selection with a powershell script. It's been a while since I've used it, so I cannot guarantee that it still works. And I'm not at my computer so formatting may not look that good.

 

$files = ListofFiles

#Generate "FiletoTape"-Objects
$filestotape = foreach($f in $files){New-VBRFileToTapeObject -Path $f.fullname -Server (Get-VBRServer -name VBRServer) -ErrorVariable +vbrerror}


#Replace Objects in File to tape job
Get-VBRTapeJob -name JobName -ErrorVariable +vbrerror | Set-VBRFileToTapeJob -Object $filestotape -ErrorVariable +vbrerror

 


JMeixner
Forum|alt.badge.img+17
  • On the path to Greatness
  • 2650 comments
  • March 4, 2023

Great approach @regnor 

Never had the use case to select a list of files for this, but good that it is possible with powershell scripting.

I will test it πŸ˜ŽπŸ‘πŸΌ


Chris.Childerhose
Forum|alt.badge.img+21
regnor wrote:

For an existing file to tape job its possible to set the file selection with a powershell script. It's been a while since I've used it, so I cannot guarantee that it still works. And I'm not at my computer so formatting may not look that good.

 

$files = ListofFiles

#Generate "FiletoTape"-Objects
$filestotape = foreach($f in $files){New-VBRFileToTapeObject -Path $f.fullname -Server (Get-VBRServer -name VBRServer) -ErrorVariable +vbrerror}


#Replace Objects in File to tape job
Get-VBRTapeJob -name JobName -ErrorVariable +vbrerror | Set-VBRFileToTapeJob -Object $filestotape -ErrorVariable +vbrerror

 

Awesome addition to this one Regnor! πŸ‘


  • Author
  • New Here
  • 2 comments
  • March 5, 2023
JMeixner wrote:

Do you have to pick some files gebrated during the day or do you vackup all files geberated during the day.

If you want to backup all new files, the File to tape jobs do incremental backups, too. Configure the job to look at at all directories the generated files are in and you should be fine.

Sorry, I probably was not very clear with my question.

I have about 8-9 TB of data per day (thanks for the rate limitation - 1Gbps - by the network switch πŸ˜ƒ) , the NAS storage is capable to keep up to 30 days of that amount. I need to move to the tape files which are older than 3 weeks, not the fresh one. Files are in multiple directories.


  • Author
  • New Here
  • 2 comments
  • March 5, 2023
regnor wrote:

For an existing file to tape job its possible to set the file selection with a powershell script. It's been a while since I've used it, so I cannot guarantee that it still works. And I'm not at my computer so formatting may not look that good.

 

$files = ListofFiles

#Generate "FiletoTape"-Objects
$filestotape = foreach($f in $files){New-VBRFileToTapeObject -Path $f.fullname -Server (Get-VBRServer -name VBRServer) -ErrorVariable +vbrerror}


#Replace Objects in File to tape job
Get-VBRTapeJob -name JobName -ErrorVariable +vbrerror | Set-VBRFileToTapeJob -Object $filestotape -ErrorVariable +vbrerror

 

Thank you, regnor! πŸ‘

I will give it a try, I hope it will work with relatively big list of files (~20,000)


regnor
Forum|alt.badge.img+14
  • Veeam MVP
  • 1354 comments
  • March 5, 2023

@Bystander I'm sure it will take some time to generate the objects with that many files. Perhaps you're able to create a filter or something similar to lower the processing time.


JMeixner
Forum|alt.badge.img+17
  • On the path to Greatness
  • 2650 comments
  • March 5, 2023
Bystander wrote:
JMeixner wrote:

Do you have to pick some files gebrated during the day or do you vackup all files geberated during the day.

If you want to backup all new files, the File to tape jobs do incremental backups, too. Configure the job to look at at all directories the generated files are in and you should be fine.

Sorry, I probably was not very clear with my question.

I have about 8-9 TB of data per day (thanks for the rate limitation - 1Gbps - by the network switch πŸ˜ƒ) , the NAS storage is capable to keep up to 30 days of that amount. I need to move to the tape files which are older than 3 weeks, not the fresh one. Files are in multiple directories.

Thank you for the clarification.

Fot this scenario a tape extent of a scale-out repository would be great. I have spoken about this with Veeam several times. We will see… 😎


Rick Vanover
Forum|alt.badge.img+10
Bystander wrote:
regnor wrote:

For an existing file to tape job its possible to set the file selection with a powershell script. It's been a while since I've used it, so I cannot guarantee that it still works. And I'm not at my computer so formatting may not look that good.

 

$files = ListofFiles

#Generate "FiletoTape"-Objects
$filestotape = foreach($f in $files){New-VBRFileToTapeObject -Path $f.fullname -Server (Get-VBRServer -name VBRServer) -ErrorVariable +vbrerror}


#Replace Objects in File to tape job
Get-VBRTapeJob -name JobName -ErrorVariable +vbrerror | Set-VBRFileToTapeJob -Object $filestotape -ErrorVariable +vbrerror

 

Thank you, regnor! πŸ‘

I will give it a try, I hope it will work with relatively big list of files (~20,000)

Inquiring minds want to know - how did it go?


Comment