Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

SCP sync to remote SSH server such as AWS #241

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oztimpower
Copy link

@oztimpower oztimpower commented Jun 6, 2020

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.

@oztimpower oztimpower force-pushed the master branch 2 times, most recently from 329a67a to 23e3dd4 Compare June 7, 2020 09:11
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant