0

I have Veeam backing up to a nas, but I'd like to copy the last backups to a removable unit every day. This means copying the vbk and vib files related to the vbk.

Example of file listing I have:

-rwxr--r--  1 root  wheel  255999550464 May 27 23:24 SRV-DATA2017-05-27T220411.vbk
-rwxr--r--  1 root  wheel     304592896 May 28 22:04 SRV-DATA2017-05-28T220053.vib
-rwxr--r--  1 root  wheel    1070917632 May 29 22:04 SRV-DATA2017-05-29T220034.vib
-rwxr--r--  1 root  wheel    1196136448 May 30 22:04 SRV-DATA2017-05-30T220037.vib
-rwxr--r--  1 root  wheel    1326031872 May 31 22:04 SRV-DATA2017-05-31T220040.vib
-rwxr--r--  1 root  wheel     865165824 Jun  1 22:04 SRV-DATA2017-06-01T220044.vib
-rwxr--r--  1 root  wheel    1169223168 Jun  2 22:04 SRV-DATA2017-06-02T220046.vib
-rwxr--r--  1 root  wheel  257745453568 Jun  3 23:25 SRV-DATA2017-06-03T220436.vbk
-rwxr--r--  1 root  wheel     280499200 Jun  4 22:04 SRV-DATA2017-06-04T220044.vib
-rwxr--r--  1 root  wheel     889518592 Jun  5 22:04 SRV-DATA2017-06-05T220046.vib
-rwxr--r--  1 root  wheel     955318784 Jun  6 22:04 SRV-DATA2017-06-06T220055.vib

Using find . -type f -size +10G -mtime -10 I can get files bigger that 10Gigs modified in the last 10 days. I know I can have the latest vbk this way.

How can I get the vib files following this vbk ?

I was thinking about extracting the date of the vbk file and get all the vib files modified after that date, but I don't know ho to translate this into bash. I tried find . -type f -size +10G -mtime -10 | xargs stat | cut -d '"' -f2 to get the date but what do I do with the date after that ?

I'm trying to do that on a nas4free unit, meaning FreeBSD.

Thanks a lot for your help.

0

If you’ve identified the vbk file (say, $vbk), do

find . -type f -newer "$vbk"
  • Thanks! I wasn't aware of this -newer switch. Definitively easier this way. – Cedric Jun 7 '17 at 18:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.