howtos:automatic_backup_via_ftp_with_fsniper
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Last revision | |||
— | howtos:automatic_backup_via_ftp_with_fsniper [02/12/2018 21:34] – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | Prereq: | ||
+ | * A ftp account | ||
+ | * Create a local directory you want to synchronize/ | ||
+ | * Create a directory on the ftp server you want to upload the content to | ||
+ | Tools: | ||
+ | < | ||
+ | sudo apt-get install fsniper lftp | ||
+ | </ | ||
+ | |||
+ | Script: | ||
+ | < | ||
+ | #!/bin/bash | ||
+ | |||
+ | trap "rm / | ||
+ | |||
+ | if [ -e / | ||
+ | then | ||
+ | echo " | ||
+ | exit 2 | ||
+ | else | ||
+ | touch / | ||
+ | lftp domingo.dk -u ftpuser, | ||
+ | lcd / | ||
+ | cd FtpSync | ||
+ | mirror -R -e | ||
+ | quit | ||
+ | EOF | ||
+ | rm / | ||
+ | exit 0 | ||
+ | fi | ||
+ | |||
+ | </ | ||
+ | |||
+ | fsniper configuration file (~/ | ||
+ | < | ||
+ | delay_time = 60 | ||
+ | delay_repeats = 0 | ||
+ | |||
+ | watch { | ||
+ | / | ||
+ | recurse = true | ||
+ | * { | ||
+ | handler = / | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Getting going: | ||
+ | First time running to get a feeling on how it works out, e.g. fixing any errors | ||
+ | < | ||
+ | fsniper --log-to-stdout | ||
+ | </ | ||
+ | |||
+ | When things work: | ||
+ | < | ||
+ | fsniper --daemon | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | ---- | ||
+ | Source: http:// |
howtos/automatic_backup_via_ftp_with_fsniper.txt · Last modified: 16/02/2023 07:16 by domingo