Hello,
I'm looking for how to re-establish a directory in the exact state at the time 
of a backup job, which means that the application files written after the 
backup must be deleted.

The goal is to restore with Where = / so that the restore is sufficient, 
without needing to go through a temporary folder (ie. / Tmp / bareos-restores) 
+ rsync -a -delete

If I understand how bareos restore files, it starts by writing the backup 
files, putting the permissions, then going back into the parent folder for 
permission, and so on.
So, and always if I understand correctly, even with Replace = Always, the 
restoration can never destroy the directory, nor the files present under the 
tree.





Practical example below:
---------------

For example, in a job 'Test' I backuped 2 files:
 / Opt / test1
 / Opt / test2

Then I create / opt / test3.

When restoring the job N by marking the / opt directory
Bareos correctly restores the files test1 and test2, but will not erase test3.


Job {
  Client = test-fd
  Name = Test
  JobDefs = "MooseJob"
  Accurate = yes
}

JobDefs {
  Name = "MooseJob"
  Type = Backup
  Level = Incremental
  Messages = "Standard"
  Storage = "vxlan1-to-Moose"
  Pool = "Incremental"
  FullBackupPool = "Full"
  IncrementalBackupPool = "Incremental"
  DifferentialBackupPool = "Differential"
  FileSet = "LinuxAll"
  Schedule = "WeeklyCycle"
  WriteBootstrap = "/var/lib/bareos/%c.bsr"
  MaximumBandwidth = 10485760
}




= Restore

Cwd is: /
$ Add opt /
3 files marked.
$ Estimate
41650 total files; 3 marked to be restored; 0 bytes.
$ Count
41,650 total files / dirs. 3 marked to be restored.
$ Done

.....
Run Restore job
JobName: RestoreFiles
Bootstrap: /var/lib/bareos/bareos-dir.restore.10.bsr
Where:
Replace: Always
FileSet: LinuxAll
Backup Client: test-fd
Restore Client: test-fd
Format: Native
Storage: vxlan1-to-Moose
When: 2017-02-24 11:38:16
Catalog: MyCatalog
Priority: 10
Plugin Options: * None *
OK to run? (Yes / mod / no): yes


Back on my test machine after restoration:

# Tree / opt /
/ Opt /
├── test1
├── test2
└── test3

The expected result was:
# Tree / opt /
/ Opt /
├── test1
└── test2

-- 
You received this message because you are subscribed to the Google Groups 
"bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to