mirror of
https://github.com/cimryan/teslausb.git
synced 2026-03-01 04:30:33 +00:00
Separate files into those used for setup and those used at runtime.
Files used for both will go in the run tree.
This commit is contained in:
16
run/rsync_archive/archive-clips.sh
Normal file
16
run/rsync_archive/archive-clips.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash -eu
|
||||
|
||||
log "Archiving through rsync..."
|
||||
|
||||
source /root/.teslaCamRsyncConfig
|
||||
|
||||
num_files_moved=$(rsync -auvh --stats --log-file=/tmp/archive-rsync-cmd.log /mnt/cam/TeslaCam/saved* $user@$server:$path | awk '/files transferred/{print $NF}')
|
||||
|
||||
/root/bin/send-pushover "$num_files_moved"
|
||||
|
||||
if [ $num_files_moved > 0 ]
|
||||
then
|
||||
log "Successfully synced files through rsync."
|
||||
else
|
||||
log "No files to archive through rsync."
|
||||
fi
|
||||
16
run/rsync_archive/configure-archive.sh
Normal file
16
run/rsync_archive/configure-archive.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash -eu
|
||||
|
||||
function configure_archive () {
|
||||
local archive_server_ip_address="$1"
|
||||
|
||||
echo "Configuring the archive..."
|
||||
|
||||
echo "Configuring for Rsync..."
|
||||
echo "user=$RSYNC_USER" > /root/.teslaCamRsyncConfig
|
||||
echo "server=$RSYNC_SERVER" >> /root/.teslaCamRsyncConfig
|
||||
echo "path=$RSYNC_PATH" >> /root/.teslaCamRsyncConfig
|
||||
}
|
||||
|
||||
ARCHIVE_SERVER_IP_ADDRESS="$( /root/bin/get-archiveserver-ip-address.sh )"
|
||||
|
||||
configure_archive "$ARCHIVE_SERVER_IP_ADDRESS"
|
||||
2
run/rsync_archive/connect-archive.sh
Normal file
2
run/rsync_archive/connect-archive.sh
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash -eu
|
||||
# Nothing to do.
|
||||
2
run/rsync_archive/disconnect-archive.sh
Normal file
2
run/rsync_archive/disconnect-archive.sh
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash -eu
|
||||
# Nothing to do.
|
||||
1
run/rsync_archive/verify-archive-configuration.sh
Normal file
1
run/rsync_archive/verify-archive-configuration.sh
Normal file
@@ -0,0 +1 @@
|
||||
#!/bin/bash -eu
|
||||
Reference in New Issue
Block a user