Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Fjen Undso
myftpdumper
Commits
834d94be
Commit
834d94be
authored
Mar 09, 2017
by
Fjen Undso
Browse files
add support for different server ports
parent
496d7b1e
Changes
1
Hide whitespace changes
Inline
Side-by-side
myftpdumper.sh
View file @
834d94be
...
...
@@ -27,8 +27,9 @@ declare -r EXLUDEDBS='^(?!(mysql|phpmyadmin|information_schema|performance_schem
declare
-r
FTPHOST
=
"example.com"
declare
-r
FTPUSER
=
""
declare
-r
FTPPASS
=
""
declare
-r
FTPTYPE
=
"sftp"
# ftp, ftps, sftp - leave empty if not desired
declare
-r
FTPPORT
=
""
# leave empty for standard protocol port
declare
-r
FTPDIR
=
"path/on/ftp"
declare
-r
FTPTYPE
=
"sftp"
# ftp or sftp - leave empty if not desired
declare
-r
FTPNUMBACKUPS
=
90
### gpg settings
declare
-r
GPGPASS
=
""
# optional gpg symmetrical passphrase
...
...
@@ -49,7 +50,11 @@ fail() {
}
execftp
()
{
lftp
-u
$FTPUSER
,
$FTPPASS
$FTPTYPE
://
$FTPHOST
-e
"
$1
"
2> /dev/null
if
[
-n
"
$FTPPORT
"
]
;
then
lftp
-p
$FTPPORT
-u
$FTPUSER
,
$FTPPASS
$FTPTYPE
://
$FTPHOST
-e
"
$1
"
2> /dev/null
else
lftp
-u
$FTPUSER
,
$FTPPASS
$FTPTYPE
://
$FTPHOST
-e
"
$1
"
2> /dev/null
fi
[
$?
-ge
1
]
\
&&
fail
"Error: ftp command failed:
$1
"
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment