#!/usr/bin/perl -T use warnings; use strict; =head1 NAME borg-restore.pl - Restore paths from borg backups =head1 DESCRIPTION borg-restore.pl helps to restore files from borg backups. It takes one path, looks for its backups, shows a list of distinct versions and allows to select one to be restored. Versions are based on the modification time of the file. It is also possible to specify a time for automatic selection of the backup that has to be restored. If a time is specified, the script will automatically select the newest backup that is at least as old as the time value that is passed and restore it without further user interaction. B has to be executed regularly, ideally after creating or removing backups. =cut =head1 OPTIONS =over 4 =item B<--help>, B<-h> Show help message. =item B<--debug> Enable debug messages. =item B<--update-cache>, B<-u> Update the lookup database. You should run this after creating or removing a backup. =item B<--destination=>I, B<-d >I Restore the backup to 'path' instead of its original location. The destination either has to be a directory or missing in which case it will be created. The backup will then be restored into the directory with its original file or directory name. =item B<--time=>I, B<-t >I Automatically find the newest backup that is at least as old as I specifies. I is a string of the form ">>" with I being one of the following: s (seconds), min (minutes), h (hours), d (days), m (months = 31 days), y (year). Example: 5.5d =back =head1 SYNOPSIS borg-restore.pl [options] Options: --help, -h short help message --debug show debug messages --update-cache, -u update cache files --destination, -d Restore backup to directory --time, -t Automatically find newest backup that is at least