diff options
author | Simon Rettberg | 2013-04-02 21:19:29 +0200 |
---|---|---|
committer | sr | 2013-04-12 19:11:40 +0200 |
commit | 7e8beb70d617c765623fc888223571f4cd94d09e (patch) | |
tree | 8c315eccbdb754976a0c175219def6dbee0e1751 /server/export_target | |
parent | fixes for disk scripts (diff) | |
download | tm-scripts-7e8beb70d617c765623fc888223571f4cd94d09e.tar.gz tm-scripts-7e8beb70d617c765623fc888223571f4cd94d09e.tar.xz tm-scripts-7e8beb70d617c765623fc888223571f4cd94d09e.zip |
Make server -s actually sync from remote server using rsync. Currently supports one hardcoded server ;-)
Diffstat (limited to 'server/export_target')
-rwxr-xr-x | server/export_target | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/server/export_target b/server/export_target index 587804d9..6ce5838c 100755 --- a/server/export_target +++ b/server/export_target @@ -19,9 +19,12 @@ MODE_DIR="${ROOT_DIR}/server" #files generated by this script land in boot SERVER_BOOT_DIR="${MODE_DIR}/boot" +# TODO: Obviously this needs to be a param to script +REMOTE_IP="132.230.102.104" + #builds from remote server -SERVER_BUILD_DIR="${MODE_DIR}/remote_builds" -REMOTE_BUILD_DIR="${ROOT_DIR}/remote/builds" +SERVER_BUILD_DIR="${MODE_DIR}/local_builds/${REMOTE_IP}" +#REMOTE_BUILD_DIR="${MODE_DIR}/remote_builds" #stage32 sqfs directory STAGE32_SQFS_DIR="${SERVER_BOOT_DIR}/stage32_sqfs/mnt" @@ -45,11 +48,9 @@ sync_remote() { pinfo "Synching 'remote/builds' to 'server/remote_builds'..." #TODO setup link to remote build directory, later this directory will be rsynced or exported to this server... - if [ ! -d "${SERVER_BUILD_DIR}" ]; then - [ ! -d "${REMOTE_BUILD_DIR}" ] && perror "remote 'builds' directory not found, exiting." - ln -s "${REMOTE_BUILD_DIR}" "${SERVER_BUILD_DIR}" - fi - + + mkdir -p "${SERVER_BUILD_DIR}" || perror "Could not create directory for local copy of remote system ($SERVER_BUILD_DIR)" + rsync -a -v -e "ssh -oStrictHostKeyChecking=no" "root@$REMOTE_IP:/export/build" "$SERVER_BUILD_DIR" || perror "rsync from 'root@$REMOTE_IP:/export/build' to '$SERVER_BUILD_DIR' failed." } generate_stage32() { |