Skip to content

Commit

Permalink
Merge pull request #17 from dgrant/fix_unmounting_usb
Browse files Browse the repository at this point in the history
Fix an issue where the postexec cmd script cannot unmount the USB backup...
  • Loading branch information
bebehei committed Apr 9, 2015
2 parents 2888dbc + 9f49292 commit 338932b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rsnapshot-program.pl
Expand Up @@ -4009,7 +4009,16 @@ sub exec_cmd {

print_cmd($cmd);
if (0 == $test) {
my $pre_systemcall_cwd = cwd();

# run $cmd from $HOME, allows unmounting of the snapshot root by
# cmd_postexec config option (se Debian Bug #660372)
chdir();
$return = system($cmd);

# return to the directory we were in before executing $cmd
chdir($pre_systemcall_cwd);

if (!defined($return)) {
print_err("Warning! exec_cmd(\"$cmd\") returned undef", 2);
}
Expand Down

0 comments on commit 338932b

Please sign in to comment.