Created
March 15, 2018 09:39
-
-
Save realflash/80b92f5892e1aecdd17d859c5838996f to your computer and use it in GitHub Desktop.
Run multiple dropboxes on Linux, and restart them if they exit.
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 | |
# CREATE THIS AS $HOME/bin/dropbox_personal/run | |
dropbox=".dropbox_personal" | |
HOME="/home/$USER" | |
if ! [ -d "$HOME/$dropbox" ] | |
then | |
mkdir "$HOME/$dropbox" 2> /dev/null | |
ln -s "$HOME/.Xauthority" "$HOME/$dropbox/" 2> /dev/null | |
fi | |
HOME="$HOME/$dropbox" | |
dropbox start 2>&1 | tee /tmp/${dropbox}.log |
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 | |
# CREATE THIS AS $HOME/bin/dropbox_work/run | |
dropbox=".dropbox_work" | |
HOME="/home/$USER" | |
if ! [ -d "$HOME/$dropbox" ] | |
then | |
mkdir "$HOME/$dropbox" 2> /dev/null | |
ln -s "$HOME/.Xauthority" "$HOME/$dropbox/" 2> /dev/null | |
fi | |
HOME="$HOME/$dropbox" | |
dropbox start 2>&1 | tee /tmp/${dropbox}.log |
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 | |
# CREATE THIS AS $HOME/bin/supervise_dropboxes.sh | |
# INSTALL daemontools package to get `supervise` | |
dropboxes="dropbox_personal dropbox_work" | |
for dropbox in $dropboxes | |
do | |
supervise $HOME/bin/$dropbox & | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment