Linux script to copy Reflect's .mrimg files based on backup method?


Author
Message
Dan Cook
Dan Cook
New Member
New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)
Group: Forum Members
Posts: 3, Visits: 8
My Reflect v7 backups are scheduled as a monthly Full, weekly Differentials, and daily Incrementals. These get stored on a network drive, which is a pool mounted on a FreeNAS server (basically FreeBSD).

On that Linux box is a Cron script (#!/bin/sh) which copies the .mrimg files to a second drive pool, just for safe-keeping. But I don't want to have all of the .mrimg files on the second pool; I just want those which make up the current backup set: latest Full, latest Differential, all Incrementals newer than latest Differential. Specifically I *don't* want to copy older Full backups because they're more than 2TB and so could cause my second drive pool to run out of room.

My Cron script is currently kind of dumb and just copies the 1 latest .mrimg file based on creation date. What I prefer is a way to inspect the Backup Method metadata of the individual files. If the newest .mrimg file is a Full, I want to empty out the destination folder before copying. If the newest is a Differential I want to delete everything except the latest Full. If the latest is Incremental then just copy it. From the included screenshot what I would want to keep is one Full, one Differential, and all newer Incrementals.

Unfortunately I don't have the Linux script experience to query the file metadata like that (I could do it in Windows, but this particular script runs on the Linux box). Anybody out there willing to teach a noob some script tricks?


http://forum.macrium.com/uploads/images/511fe485-3b2e-4fb6-aac9-8a49.jpg
Edited 17 March 2017 8:08 PM by Dan Cook
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Login

Explore
Messages
Mentions
Search