Setup Barracuda Copy Console on Ubuntu 14.04 & ServerPilot
#!/bin/sh
# CopyConsole (Copy cloud storage by Barracuda) service
copyConsolePath="/srv/users/serverpilot/scripts/copy/CopyConsole"
copyUser="serverpilot"
userHomeDir="/srv/users/serverpilot"
start() {
echo "Starting CopyConsole..."
if [ -x $copyConsolePath ]; then
HOME="$userHomeDir" start-stop-daemon -b -o -c $copyUser -S -u $copyUser -x $copyConsolePath -- -daemon
fi
}
stop() {
echo "Stopping CopyConsole..."
if [ -x $copyConsolePath ]; then
start-stop-daemon -o -c $copyUser -K -u $copyUser -x $copyConsolePath
fi
}
status() {
dbpid=`pgrep -u $copyUser CopyConsole`
if [ -z $dbpid ] ; then
echo "CopyConsole for USER $copyUser: not running."
else
echo "CopyConsole for USER $copyUser: running (pid $dbpid)"
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload|force-reload)
stop
start
;;
status)
status
;;
*)
echo "Usage: /etc/init.d/copyconsole {start|stop|reload|force-reload|restart|status}"
exit 1
esac
exit 0
This assumes you've already got a working copy of Ubuntu 14.04 and ServerPilot setup.
For my configuration, I'm putting the sync folder at /srv/users/serverpilot/copy
and the scripts at /srv/users/serverpilot/scripts/copy
. You can adjust as you see fit.
SSH in as serverpilot user
Create some directories
mkdir -p /srv/users/serverpilot/scripts/copy_temp` #install folder
mkdir /srv/users/serverpilot/scripts/copy` #app folder
mkdir /srv/users/serverpilot/copy` #sync folder
Download
wget https://copy.com/install/linux/Copy.tgz -P /srv/users/serverpilot/scripts/copy_temp
Extract to temp dir
tar xvzf /srv/users/serverpilot/scripts/copy_temp/Copy.tgz -C /srv/users/serverpilot/scripts/copy_temp
Move 64bit version to a permanent director
mv /srv/users/serverpilot/scripts/copy_temp/copy/x86_64 /srv/users/serverpilot/scripts/copy
Fire it up
Make sure and swap out the user and password. If you'd like, you can leave off the password and type it in after running the script to avoid logging it to the bash history
/srv/users/serverpilot/scripts/copy/CopyConsole -r=/srv/users/serverpilot/copy -u=the_mail_you_signed_up_with -p=the_password_you_signed_up_with
Press Control + C once you've got it setup and running.
Log into server as root
Create /etc/init.d/CopyConsole
touch /etc/init.d/CopyConsole
nano /etc/init.d/CopyConsole
Paste the contents of CopyConsole into there, then press control + x to exit. Press enter to save it under the same name.
chmod +x /etc/init.d/CopyConsole
update-rc.d CopyConsole defaults
Symlink it
ln -s /etc/init.d/CopyConsole /usr/bin/CopyConsole
Fire it up
CopyConsole start
CopyConsole {start|stop|reload|force-reload|restart|status}
CopyConsole start
CopyConsole status
CopyConsole stop