Solved

Set a file list for backup in before job script


Userlevel 2

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

 

icon

Best answer by regnor 4 March 2023, 10:01

View original

10 comments

Userlevel 7
Badge +20

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

 

Userlevel 7
Badge +17

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.

Userlevel 7
Badge +12

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

 

Userlevel 7
Badge +17

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 😎👍🏼

Userlevel 7
Badge +20

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! 👍

Userlevel 2

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.

Userlevel 2

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)

Userlevel 7
Badge +12

@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.

Userlevel 7
Badge +17

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… 😎

Userlevel 7
Badge +10

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