Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
backupninja
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Liberate
backupninja
Commits
995e34e1
Commit
995e34e1
authored
19 years ago
by
elijah
Browse files
Options
Downloads
Patches
Plain Diff
created function maketemp, to be used by backupninja
and maildir handler for creating safe temp files.
parent
ef4bbe3c
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
backupninja
+18
-8
18 additions, 8 deletions
backupninja
changelog
+2
-0
2 additions, 0 deletions
changelog
handlers/maildir
+13
-3
13 additions, 3 deletions
handlers/maildir
with
33 additions
and
11 deletions
backupninja
+
18
−
8
View file @
995e34e1
...
...
@@ -131,6 +131,23 @@ function setsection() {
CURRENT_SECTION
=
$1
}
#
# create a temporary file in a secure way.
#
function
maketemp
()
{
if
[
-x
/bin/mktemp
]
then
local
tempfile
=
`
mktemp
/tmp/
$1
.XXXXXXXX
`
else
DATE
=
`
date
`
sectmp
=
`
echo
$DATE
| /usr/bin/md5sum |
cut
-d-
-f1
`
local
tempfile
=
/tmp/
$1
.
$sectmp
fi
echo
$tempfile
}
#
# sets a global var with name equal to $1
# to the value of the configuration parameter $1
...
...
@@ -305,14 +322,7 @@ function process_action() {
let
"actions_run += 1"
# call the handler:
if
[
-x
/bin/mktemp
]
then
local
bufferfile
=
`
mktemp
/tmp/backupninja.buffer.XXXXXXXX
`
else
DATE
=
`
date
`
sectmp
=
`
echo
$DATE
| /usr/bin/md5sum |
cut
-d-
-f1
`
local
bufferfile
=
/tmp/backupninja.buffer.
$sectmp
fi
local
bufferfile
=
`
maketemp backupninja.buffer
`
echo
""
>
$bufferfile
echo_debug_msg
=
1
(
...
...
This diff is collapsed.
Click to expand it.
changelog
+
2
−
0
View file @
995e34e1
version 0.9 -- unreleased
removed erroneous magic file marker in pgsql handler
fixed insecure temporary file creation
fixed incorrect find positional
version 0.8 -- September 15 2005
added pgsql (PostgreSQL) handler, with vservers support.
added vservers support to duplicity handler
...
...
This diff is collapsed.
Click to expand it.
handlers/maildir
+
13
−
3
View file @
995e34e1
...
...
@@ -13,6 +13,16 @@
# monthly.1
# if keepdaily is 3, keepweekly is 2, and keepmonthly is 1.
#
# The basic algorithm is to rsync each maildir individually,
# and to use hard links for retaining historical data.
#
# We rsync each maildir individually because it becomes very
# unweldy to start a single rsync of many hundreds of thousands
# of files.
#
# For the backup rotation to work, destuser must be able to run
# arbitrary bash commands on the desthost.
#
##############################################################
getconf rotate yes
...
...
@@ -101,8 +111,8 @@ $dir $destuser@$desthost:$destdir/$letter \
# and add new ones which have just been created.
function do_remove() {
local tmp1=
/t
mp
/
maildirtmpfile
$$
local tmp2=
/t
mp
/
maildirtmpfile
$$
local tmp1=
`makete
mp
maildir
-
tmp
-
file
`
local tmp2=
`makete
mp
maildir
-
tmp
-
file
`
for i in a b c d e f g h i j k l m n o p q r s t u v w x y z; do
ls -1 "$srcdir/$i" | sort > $tmp1
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment