Created
May 29, 2016 18:34
-
-
Save kylerbrown/31b6154de57c618e2d05e9fecd7c598e to your computer and use it in GitHub Desktop.
backup script for 24/7 Intan RHD recording
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Rational ## | |
# A lot of data can be generated quickly with the Intan system. To keep the experimental computer | |
# from running out of space, the data should be regularly copied to a server and removed locally. | |
# This script does that safely by: | |
# 1) recursively copying all *.rhd files and deleting them after safe copy. | |
# 2) recursively copying everything else, but not deleting (saving notes and settings on the experimenal computer. | |
## Usage ## | |
# bash backup.sh LOCAL/DATA/DIRECTORY REMOTE:DATA/DIRECTORY | |
# Make sure you have shared your ssh keys with the remote computer | |
local="$1" | |
remote="$2" | |
cd $local | |
find ./ -name "*.rhd" -cmin +11 -print0 | \ | |
rsync -auv --files-from=- --from0 --remove-source-files ./ $remote | |
find ./ -not -name "*.rhd" -print0 | \ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment