Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
duplicity-ftp-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
Service Desk
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
NoCloud
duplicity-ftp-backup
Commits
47479a34
Verified
Commit
47479a34
authored
4 years ago
by
David Beniamine
Browse files
Options
Downloads
Patches
Plain Diff
Allow to choose confifile
parent
1936ccd8
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
backup.sh
+4
-0
4 additions, 0 deletions
backup.sh
clear_backup.sh
+4
-0
4 additions, 0 deletions
clear_backup.sh
inc.sh
+4
-1
4 additions, 1 deletion
inc.sh
restore_file.sh
+28
-9
28 additions, 9 deletions
restore_file.sh
with
40 additions
and
10 deletions
backup.sh
+
4
−
0
View file @
47479a34
#!/bin/bash
DIR
=
$(
realpath
$(
dirname
$0
))
if
[
!
-z
"
$1
"
]
;
then
conf_file
=
$1
shift
fi
source
$DIR
/inc.sh
exit_on_fail
(){
...
...
This diff is collapsed.
Click to expand it.
clear_backup.sh
+
4
−
0
View file @
47479a34
#!/bin/bash
DIR
=
$(
realpath
$(
dirname
$0
))
if
[
!
-z
"
$1
"
]
;
then
conf_file
=
$1
shift
fi
source
$DIR
/inc.sh
export
PASSPHRASE
=
"
$encpass
"
...
...
This diff is collapsed.
Click to expand it.
inc.sh
+
4
−
1
View file @
47479a34
#!/bin/bash
DIR
=
$(
realpath
$(
dirname
$0
))
source
$DIR
/.env
if
[
-z
"
$conf_file
"
]
;
then
conf_file
=
"
$DIR
/.env"
fi
source
$conf_file
# Exit the script and sendmail
# $1 : exit code
...
...
This diff is collapsed.
Click to expand it.
restore_file.sh
+
28
−
9
View file @
47479a34
#!/bin/bash
DIR
=
$(
realpath
$(
dirname
$0
))
source
$DIR
/inc.sh
if
[
-z
"
$2
"
]
;
then
echo
"Usage
$0
<restore_path> <destination_path> [timeago]"
usage
(){
echo
"Usage
$0
[options] <restore_path> <destination_path>"
echo
"restore_path : path to restore without leading slash"
echo
"destination_path : path to download the file(s), duplicity will not override existing files"
echo
"timeago : optionnal : the age of the version we want to restore, for instance 6D for 6 days ago"
echo
"options"
echo
" -t timeago : the age of the version we want to restore, for instance 6D for 6 days ago"
echo
" -c file : config_file to use"
}
while
getopts
"t:c:h"
arg
;
do
case
${
arg
}
in
h
)
usage
exit
0
;;
t
)
delay
=
"-t
$OPTARG
"
;;
c
)
conf_file
=
$OPTARG
;;
esac
done
restore_path
=
${
@
:
$OPTIND
:1
}
destination_path
=
${
@
:
$OPTIND
+1
:1
}
if
[
-z
"
$destination_path
"
]
;
then
usage
exit
1
fi
if
[
!
-z
"
$3
"
]
;
then
delay
=
"-t
$3
"
fi
source
$DIR
/inc.sh
export
PASSPHRASE
=
"
$encpass
"
export
FTP_PASSWORD
=
"
$ftppass
"
/usr/bin/duplicity
--file-to-restore
$delay
"
$
1
"
ftp://
$user
@
$host
/
$remotedir
/
"
$
2
"
/usr/bin/duplicity
--file-to-restore
$delay
"
$
restore_path
"
ftp://
$user
@
$host
/
$remotedir
/
"
$
destination_path
"
unset
PASSPHRASE
unset
FTP_PASSWORD
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