Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iml-backup
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
iml-backup
Commits
29857b36
Commit
29857b36
authored
3 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
transfer.sh: update logging (ticket 5055)
parent
4130ad17
No related branches found
No related tags found
1 merge request
!38
5046 finetune restic params
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
transfer.sh
+18
-15
18 additions, 15 deletions
transfer.sh
with
18 additions
and
15 deletions
transfer.sh
+
18
−
15
View file @
29857b36
...
...
@@ -29,6 +29,7 @@
# 2021-01-29 ah,ds, v1.12 abort on empty passphrase
# 2021-05-19 ah,ds, v2.0 plugin driven to support multiple backup tools (duplicity + restic)
# 2021-12-02 ah v2.1 added parameter "prune" to cleanup only
# 2022-02-10 ah v2.2 update logging (removing tee)
# ================================================================================
...
...
@@ -130,14 +131,16 @@
if
[
"
$1
"
=
"prune"
]
;
then
doBackup
=
0
fi
exec
1>
>(
tee
-a
"
$transferlog
"
)
2>&1
echo
"INFO: Start logging into
$transferlog
"
h1
`
date
`
TRANSFER LOCAL DATA TO STORAGE
|
tee
-a
$transferlog
h1
`
date
`
TRANSFER LOCAL DATA TO STORAGE
echo
"METHOD :
$METHOD
"
|
tee
-a
$transferlog
echo
"TARGET :
${
STORAGE_BASEDIR
}
"
|
tee
-a
$transferlog
echo
"REGISTER :
${
STORAGE_REGISTER
}
"
|
tee
-a
$transferlog
echo
"TOOL :
$STORAGE_BIN
"
|
tee
-a
$transferlog
echo
|
tee
-a
$transferlog
echo
"METHOD :
$METHOD
"
echo
"TARGET :
${
STORAGE_BASEDIR
}
"
echo
"REGISTER :
${
STORAGE_REGISTER
}
"
echo
"TOOL :
$STORAGE_BIN
"
echo
.
`
dirname
$0
`
/plugins/transfer/
$STORAGE_BIN
.sh
||
exit
1
test
-z
"
$STORAGE_REGISTER
"
||
.
`
dirname
$0
`
/plugins/register/
$STORAGE_REGISTER
.sh
||
exit
1
...
...
@@ -242,7 +245,7 @@
sleep
$iRnd
fi
done
fi
|
tee
-a
$transferlog
fi
h2
"
`
date
`
PRE transfer tasks"
...
...
@@ -345,7 +348,7 @@
echo
$rc
>
${
rcfile
}
exit
$rc
)
|
tee
-a
$transferlog
)
# rc=${PIPESTATUS[0]}
rc
=
`
cat
${
rcfile
}
`
...
...
@@ -364,22 +367,22 @@
echo
"SKIP"
else
unregisterBackupSlot
`
hostname
-f
`
$rc
fi
|
tee
-a
$transferlog
fi
h2
"
`
date
`
Backup finished"
echo
STATUS
$0
exit
with final returncode
rc
=
$rc
|
tee
-a
$transferlog
echo
|
tee
-a
$transferlog
echo
STATUS
$0
exit
with final returncode
rc
=
$rc
echo
if
[
$rc
-eq
0
]
;
then
color ok
echo
Backup OK
|
tee
-a
$transferlog
echo
Backup OK
else
color error
echo
Backup FAILED :-/
|
tee
-a
$transferlog
echo
Backup FAILED :-/
fi
color reset
echo
|
tee
-a
$transferlog
echo
typeset
-i
TIMER_TRANSFER
=
`
date
+%s
`
-
$TIMER_TRANSFER_START
echo
`
date
`
TRANSFER DONE
in
$TIMER_TRANSFER
sec
|
tee
-a
$transferlog
echo
`
date
`
TRANSFER DONE
in
$TIMER_TRANSFER
sec
ls
-l
$transferlog
exit
$rc
...
...
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