File: tarssh-sudo.pl

package info (click to toggle)
backuppc 4.4.0-11
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,752 kB
  • sloc: perl: 37,523; sh: 607; javascript: 176; makefile: 38; ansic: 6
file content (22 lines) | stat: -rw-r--r-- 857 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#
# Tar backup over ssh using SUDO with user 'backuppc'
#
# You should generate an SSH key pair to allow the local 'backuppc' user
# to connect as 'backuppc' on the target host.
# Please refer to the BackupPC's manual for key generation details.
#
# Then on the client host added the following line to 'sudoers' with 'visudo':
#    backuppc ALL=NOPASSWD: /bin/tar
#

$Conf{XferMethod} = 'tar';

$Conf{TarClientCmd} = '$sshPath -q -x -n -l backuppc $host'
                     . ' /usr/bin/env LC_ALL=C sudo $tarPath -c -v -f - -C $shareName+'
                     . ' --totals';
					  
$Conf{TarClientRestoreCmd} = '$sshPath -q -x -l backuppc $host'
                      . ' /usr/bin/env LC_ALL=C sudo $tarPath -x -p --numeric-owner --same-owner'
                      . ' -v -f - -C $shareName+';

$Conf{BackupFilesOnly} = [ '/onedir', '/anotherdir' ];