Permalink
Browse files

Closing bug: #138

Support for BM_TEMP_DIR



git-svn-id: svn://svn.backup-manager.org/backup-manager/trunk@566 2e458433-d701-0410-9826-f9b593394a3c
  • Loading branch information...
1 parent 19ec9e6 commit 476e39dfe87a6e94bef49fe42b8c35f8ae5011c0 sukria committed Mar 16, 2008
Showing with 19 additions and 13 deletions.
  1. +3 −0 backup-manager.conf.tpl
  2. +5 −5 lib/backup-methods.sh
  3. +2 −2 lib/burning-methods.sh
  4. +1 −1 lib/files.sh
  5. +3 −0 lib/sanitize.sh
  6. +5 −5 lib/upload-methods.sh
View
@@ -15,6 +15,9 @@
# Where to store the archives
export BM_REPOSITORY_ROOT="/var/archives"
+# Where to place temporary files
+export BM_TEMP_DIR="/tmp"
+
# For security reasons, the archive repository and the generated
# archives will be readable/writable by a given user/group.
# This is recommended to set this to true.
View
@@ -130,7 +130,7 @@ function __exec_meta_command()
warning "File \$file_to_create already exists, skipping."
export BM_RET=""
else
- logfile=$(mktemp /tmp/bm-command.XXXXXX)
+ logfile=$(mktemp ${BM_TEMP_DIR}/bm-command.XXXXXX)
case "$compress" in
"gzip"|"gz"|"bzip"|"bzip2")
@@ -568,7 +568,7 @@ function build_clear_archive
{
debug "build_clear_archive ()"
- logfile=$(mktemp /tmp/bm-tarball.log.XXXXXX)
+ logfile=$(mktemp ${BM_TEMP_DIR}/bm-tarball.log.XXXXXX)
debug "logfile: $logfile"
# A couple of archive types have a special command line
@@ -609,7 +609,7 @@ function build_clear_archive
function build_encrypted_archive
{
debug "build_encrypted_archive"
- logfile=$(mktemp /tmp/bm-tarball.log.XXXXXX)
+ logfile=$(mktemp ${BM_TEMP_DIR}/bm-tarball.log.XXXXXX)
debug "logfile: $logfile"
if [[ -z "$BM_ENCRYPTION_RECIPIENT" ]]; then
@@ -681,7 +681,7 @@ function __build_remote_archive()
for host in $BM_UPLOAD_SSH_HOSTS
do
- logfile=$(mktemp /tmp/bm-tarball.log.XXXXXX)
+ logfile=$(mktemp ${BM_TEMP_DIR}/bm-tarball.log.XXXXXX)
file_to_create=$(__get_file_to_create_remote "$target" "$host")
command=$(__get_backup_tarball_remote_command) ||
@@ -692,7 +692,7 @@ function __build_remote_archive()
if [[ ! -e "$file_to_check" ]] || [[ $force = true ]]; then
- logfile=$(mktemp /tmp/bm-tarball.log.XXXXXX)
+ logfile=$(mktemp ${BM_TEMP_DIR}/bm-tarball.log.XXXXXX)
debug "$remote_command > $file_to_create 2>$logfile"
tail_logfile "$logfile"
View
@@ -54,7 +54,7 @@ function check_cdrom_md5_sums()
fi
# first create the mount point
- mount_point="$(mktemp -d /tmp/bm-mnt.XXXXXX)"
+ mount_point="$(mktemp -d ${BM_TEMP_DIR}/bm-mnt.XXXXXX)"
if [[ ! -d $mount_point ]]; then
error "The mount point \$mount_point is not there."
fi
@@ -263,7 +263,7 @@ function burn_session()
bm_safe_unmount $BM_BURNING_DEVICE
# get a log file in a secure path
- logfile="$(mktemp /tmp/bm-burning.log.XXXXXX)"
+ logfile="$(mktemp ${BM_TEMP_DIR}/bm-burning.log.XXXXXX)"
info "Redirecting burning logs into \$logfile"
# set the cdrecord command
View
@@ -350,7 +350,7 @@ function clean_directory()
# First list all the files to process
# and ask backup-manager-purge what to remove
- list=$(mktemp /tmp/bm-list.XXXXXX)
+ list=$(mktemp ${BM_TEMP_DIR}/bm-list.XXXXXX)
# files & symlinks
find $find_opt "$directory" $maxdepth \
View
@@ -121,6 +121,9 @@ replace_deprecated_booleans
confkey_handle_deprecated "BM_ARCHIVES_REPOSITORY" "BM_REPOSITORY_ROOT"
confkey_require "BM_REPOSITORY_ROOT" "/var/archives"
+# The temp dir used by BM
+confkey_require "BM_TEMP_DIR" "/tmp"
+
# let's drop the trailing slash, if any.
export BM_REPOSITORY_ROOT="${BM_REPOSITORY_ROOT%/}"
View
@@ -59,7 +59,7 @@ bm_upload_ssh()
fi
# Call to backup-manager-upload
- logfile="$(mktemp /tmp/bmu-log.XXXXXX)"
+ logfile="$(mktemp ${BM_TEMP_DIR}/bmu-log.XXXXXX)"
$bmu $v_switch $k_switch $ssh_purge_switch -m="scp" \
-h="$bm_upload_hosts" \
-u="$BM_UPLOAD_SSH_USER" \
@@ -95,7 +95,7 @@ bm_upload_ssh_gpg()
fi
# Call to backup-manager-upload
- logfile="$(mktemp /tmp/bmu-log.XXXXXX)"
+ logfile="$(mktemp ${BM_TEMP_DIR}/bmu-log.XXXXXX)"
$bmu $v_switch $k_switch -m="ssh-gpg" \
-h="$bm_upload_hosts" \
-u="$BM_UPLOAD_SSH_USER" \
@@ -128,7 +128,7 @@ bm_upload_ftp()
ftp_purge_switch="--ftp-purge"
fi
- logfile="$(mktemp /tmp/bmu-log.XXXXXX)"
+ logfile="$(mktemp ${BM_TEMP_DIR}/bmu-log.XXXXXX)"
$bmu $v_switch $ftp_purge_switch \
-m="ftp" \
-h="$bm_upload_hosts" \
@@ -158,7 +158,7 @@ bm_upload_s3()
s3_purge_switch="--s3-purge"
fi
- logfile="$(mktemp /tmp/bmu-log.XXXXXX)"
+ logfile="$(mktemp ${BM_TEMP_DIR}/bmu-log.XXXXXX)"
$bmu $v_switch $s3_purge_switch \
-m="s3" \
-h="$bm_upload_hosts" \
@@ -172,7 +172,7 @@ bm_upload_s3()
_exec_rsync_command()
{
info "Uploading \$directory to \${host}:\${BM_UPLOAD_RSYNC_DESTINATION}"
- logfile=$(mktemp /tmp/bm-rsync.XXXXXX)
+ logfile=$(mktemp ${BM_TEMP_DIR}/bm-rsync.XXXXXX)
# default options for local rsync
ssh_option=""

0 comments on commit 476e39d

Please sign in to comment.