#!/bin/sh
PATH=/usr/local/bin:/usr/local/sbin:~/bin:/usr/bin:/bin:/usr/sbin:/sbin
ISO_TIMESTAMP=`date +"%Y-%m-%dT%H:%M:%S"`

# This script backups local source file to remote timestamped target file.
# Please change the variables in step (1) first before running the script.

# (1) set up all backup varables
COMMANDER_HOME=/path/to/crossftp-all-bin
SOURCE_FILE_PATH=/path/to/source/file
TARGET_SITE_ID=ID
TARGET_FILE_PATH=/path/to/target/file.$ISO_TIMESTAMP

# (2) start backup
echo "Backup ${SOURCE_FILE_PATH} to remote file ${TARGET_FILE_PATH}"

cd $COMMANDER_HOME && ./commander.sh --action copy --sourceSite MyComputer --sourceFile $SOURCE_FILE_PATH --targetSite $TARGET_SITE_ID --targetFile $TARGET_FILE_PATH

# (3) show user the result
echo "Finished backup ${SOURCE_FILE_PATH} to remote file ${TARGET_FILE_PATH}"
