Setup Dropbox on Debian 64bit
Add this line to ~/.profile
export PATH=$HOME/bin:$PATH
Create /etc/init.d/dropbox
Add the contents of the file below
Make the script executable and add it to the system startup
sudo chmod +x /etc/init.d/dropbox
sudo update-rc.d dropbox defaults
You can safely ignore the following messages
update-rc.d: using dependency based boot sequencing
insserv: warning: script 'dropbox' missing LSB tags and overrides
You can restart your server to test it. Use with caution though. I'd only do this on a dev box.
shutdown -r now
~/bin/dropbox.py status
Install Access Control List
sudo apt-get install acl
Give www-data user read, write & execute access to dropbox files
setfacl -Rm u:www-data:rwx /root/Dropbox
Set as default, recursively to inherit these settings on newly created files
setfacl -dRm u:www-data:rwx /root/Dropbox
Install the GD Library
apt-get install php5-gd
Start by creating an entry in the sudoers list. You can name it whatever you want, "Webserver" can be named anything because any file in this directory is automatically included.
visudo -f /etc/sudoers.d/Webserver
Add the following to it:
www-data ALL = (root) NOPASSWD: /var/www/kirby-farm/conf/parse_clients.sh
press control + x
then type Y
and hit enter
#!/bin/sh
#located at /etc/init.d/dropbox
#dropbox service
DROPBOX_USERS="root"
DAEMON=.dropbox-dist/dropbox
start() {
echo "Starting dropbox..."
for dbuser in $DROPBOX_USERS; do
HOMEDIR=`getent passwd $dbuser | cut -d: -f6`
if [ -x $HOMEDIR/$DAEMON ]; then
HOME="$HOMEDIR" start-stop-daemon -b -o -c $dbuser -S -u $dbuser -x $HOMEDIR/$DAEMON
fi
done
}
stop() {
echo "Stopping dropbox..."
for dbuser in $DROPBOX_USERS; do
HOMEDIR=`getent passwd $dbuser | cut -d: -f6`
if [ -x $HOMEDIR/$DAEMON ]; then
start-stop-daemon -o -c $dbuser -K -u $dbuser -x $HOMEDIR/$DAEMON
fi
done
}
status() {
for dbuser in $DROPBOX_USERS; do
dbpid=`pgrep -u $dbuser dropbox`
if [ -z $dbpid ] ; then
echo "dropboxd for USER $dbuser: not running."
else
echo "dropboxd for USER $dbuser: running (pid $dbpid)"
fi
done
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload|force-reload)
stop
start
;;
status)
status
;;
*)
echo "Usage: /etc/init.d/dropbox {start|stop|reload|force-reload|restart|status}"
exit 1
esac
exit 0