-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[backup_ovh] move getftp to backup_ovh
- Loading branch information
Showing
2 changed files
with
19 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#/bin/sh | ||
|
||
CONFIG="${HOME}/.config/backup_ovh.conf" | ||
if [ ! -f "$CONFIG" ] ; then | ||
echo "[ERROR] config expected at $CONFIG" | ||
echo "[ERROR] Expected content:" | ||
echo " URI_BACKUP= # An URI to access to trigger a backup" | ||
echo " USERNAME= # The user to the ftp server" | ||
echo " PASSWORD= # The password to the ftp server" | ||
echo " HOST= # The host to backup" | ||
echo " DESTDIR=\"\${HOME}/Téléchargements/\${HOST}\" # Where to store the backup" | ||
exit 1 | ||
fi | ||
|
||
source "${CONFIG}" | ||
|
||
wget -qnv -O - ${URI_BACKUP} > /dev/null | ||
lftp -u $USERNAME,$PASSWORD "ftp://$HOST" -e "mirror -e . -P10 $DESTDIR ; quit" | ||
echo $(date -I) > $DESTDIR/backup_date.txt |
This file was deleted.
Oops, something went wrong.