SCP sync to remote SSH server such as AWS #241
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Script to run from cron that can sync the recordings to a target SSH server via scp.
Generate a rsa key via:
dropbearkey -t rsa -f /home/yi-hack-v4/.ssh/transfer-key
Edit the config file with destination path, user, and hostname:
vi /home/yi-hack-v4/etc/push.conf
Copy the public key to your target server
$HOME/.ssh/authorised_keys
via:dropbearkey -y -f /home/yi-hack-v4/.ssh/transfer-key
Execute
/home/yi-hack-v4/script/push.sh -h
to sync the recordings for that hour from cron. It will only publish files that have changed, you can run every minute if you wanted to.eg.
*/10,59 * * * * /home/yi-hack-v4/script/push.sh -h
Files are synced using the -h option for the hour that they run. If at the end of the hour a sleep is done to ensure all files are written and copied.