technote:syncwatcher
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
technote:syncwatcher [2019/04/13 02:03] – Gerard Nicol | technote:syncwatcher [2025/01/21 22:07] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Running Syncs with inotify | + | ====== Running Syncs with incrond |
+ | {{tag> | ||
- | |||
- | <sxh bash;> | ||
- | #!/bin/bash | ||
- | |||
- | function control_c { | ||
- | | ||
- | exit | ||
- | }; | ||
- | |||
- | set -e | ||
- | |||
- | trap control_c SIGINT | ||
- | trap control_c SIGTERM | ||
- | |||
- | logger -s -t TapeTrackSyncWatcher Starting TapeTrack Sync Watcher | ||
- | |||
- | outfile=$(mktemp " | ||
- | |||
- | while true; do | ||
- | # | ||
- | # Wait on a change to the sftp directory | ||
- | # | ||
- | | ||
- | |||
- | # | ||
- | # A chance has been made so read the results into 3 variables (path, type, file) | ||
- | # | ||
- | read -r r1 r2 r3 < $outfile | ||
- | |||
- | # | ||
- | # Delete the temp file | ||
- | # | ||
- | rm $outfile | ||
- | |||
- | | ||
- | |||
- | if grep -q "/ | ||
- | logger -s -t TapeTrackSyncWatcher Launching Sync fpr file $r1$r3 | ||
- | now=$(date +" | ||
- | syncfile=$r1$r3 TMSS10Sync -d $base/ | ||
- | else | ||
- | logger -s -t TapeTrackSyncWatcher Skipping file update for file $r1$r3 | ||
- | fi | ||
- | done | ||
- | |||
- | exit | ||
- | </ |
technote/syncwatcher.1555120980.txt.gz · Last modified: 2025/01/21 22:07 (external edit)