diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2008-06-14 22:07:09 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2008-06-14 22:07:09 +0000 |
commit | 5fc20afe2bb1d1cb17303fe16dfe3cbea7ef1c12 (patch) | |
tree | fed6ac961cdfe8b3c9840f1002202d2dc46f7200 /lbu | |
parent | 8fcae700d2f7b9d10819cc55c67a2ea6c89a4a60 (diff) | |
download | alpine-conf-5fc20afe2bb1d1cb17303fe16dfe3cbea7ef1c12.zip |
create backups
Diffstat (limited to 'lbu')
-rw-r--r-- | lbu | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -324,6 +324,7 @@ cmd_commit() { outfile="$outfile.$ENCRYPTION" fi + # remove old config files if [ -n "$DELETEOLDCONFIGS" ] ; then local rmfiles=$(ls "$mnt/"*.apkovl.tar.gz* 2>/dev/null) @@ -337,7 +338,12 @@ cmd_commit() { fi else lines=$(ls -1 "$mnt"/*.apkovl.tar.gz* 2>/dev/null) - if [ -n "$lines" ] && [ "$lines" != "$outfile" ]; then + if [ "$lines" = "$outfile" ]; then + local d=$( date -r "$outfile" "+%Y%m%d%H%m%S" ) + local backup=$(echo "$outfile" | sed "s/\.apkovl\.tar\.gz/.$d.tar.gz/") + vecho "Creating backup $backup" + [ -z "$DRYRUN" ] && mv "$outfile" "$backup" + elif [ -n "$lines" ]; then # More then one apkovl, this is a security concern [ -z "$was_mounted" ] && umount "$mnt" eecho "The following apkovl file(s) were found:" |