Skip to content

Commit

Permalink
2006-08-07 Alexis Sukrieh <sukria@backup-manager.org>
Browse files Browse the repository at this point in the history
	* lib/backup-methods.sh:
	  + the dar build commandline is now working.
	    (closes: #109)




git-svn-id: svn://svn.backup-manager.org/backup-manager/trunk@468 2e458433-d701-0410-9826-f9b593394a3c
  • Loading branch information
sukria committed Aug 7, 2006
1 parent cf53890 commit e372cd2
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 20 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
@@ -1,3 +1,9 @@
2006-08-07 Alexis Sukrieh <sukria@backup-manager.org>

* lib/backup-methods.sh:
+ the dar build commandline is now working.
(closes: #109)

2006-08-05 Alexis Sukrieh <sukria@backup-manager.org>

* backup-manager:
Expand Down
55 changes: 35 additions & 20 deletions lib/backup-methods.sh
Expand Up @@ -416,7 +416,7 @@ function __get_backup_tarball_command()
error "The archive type \"dar\" depends on the tool \"\$dar\"."
fi
__get_flags_dar_blacklist "$target"
command="$dar $incremental $blacklist $maxsize $overwrite $BM_TARBALL_EXTRA_OPTIONS -z9 -Q -c -R"
command="$dar $incremental $blacklist $maxsize $overwrite $BM_TARBALL_EXTRA_OPTIONS -z9 -Q -c $file_to_create -R"
;;
*)
error "The archive type \"\$BM_TARBALL_FILETYPE\" is not supported."
Expand All @@ -430,25 +430,40 @@ function build_clear_archive
{
logfile=$(mktemp /tmp/bm-tarball.log.XXXXXX)

# This is a dirty hack, we have to do it like that unless
# tar provides support for lzma compression internally.
if [ "$BM_TARBALL_FILETYPE" = "tar.lz" ];then
$tar $incremental $blacklist $dumpsymlinks $BM_TARBALL_EXTRA_OPTIONS -p -c -f - $target 2>>$logfile | $lzma -si e $file_to_create 2>>$logfile
if [ $? -gt 0 ]; then
handle_tarball_error "$file_to_create" "$logfile"
else
rm -f $logfile
commit_archives "$file_to_create"
fi
# The common case
else
if ! `$command $file_to_create "$target"> $logfile 2>&1`; then
handle_tarball_error "$file_to_create" "$logfile"
else
rm -f $logfile
commit_archives "$file_to_create"
fi
fi
# A couple of archive types have a special command line
case "$BM_TARBALL_FILETYPE" in

# lzma archives should be piped manually
"tar.lz")
$tar $incremental $blacklist $dumpsymlinks $BM_TARBALL_EXTRA_OPTIONS -p -c -f - $target 2>>$logfile | $lzma -si e $file_to_create 2>>$logfile
if [ $? -gt 0 ]; then
handle_tarball_error "$file_to_create" "$logfile"
else
rm -f $logfile
commit_archives "$file_to_create"
fi
;;

# dar has a special commandline, that cannot fit the common tar way
"dar")
if ! `$command "$target"> $logfile 2>&1`; then
handle_tarball_error "$file_to_create" "$logfile"
else
rm -f $logfile
commit_archives "$file_to_create"
fi
;;

# the common commandline
*)
if ! `$command $file_to_create "$target"> $logfile 2>&1`; then
handle_tarball_error "$file_to_create" "$logfile"
else
rm -f $logfile
commit_archives "$file_to_create"
fi
;;
esac
}

function build_encrypted_archive
Expand Down

0 comments on commit e372cd2

Please sign in to comment.