Running Insync portable on startup with Raspberry Pi

I just downloaded insync-portable and have it up and running, was easy to add an account and sync my data. However I have to run the ./insync-portable start command everytime I reboot my raspberry pi. Is there a way to initialise this script at startup? Please be verbose, I’m a newbie to linux. Any help would greatly be appreciated.

For some extra information, I’ve added @reboot /home/pi/insync-portable/insync-portable start to my crontab, as well as the information on this page to create a file in init.d. Neither of these seem to work, or perhaps I’m doing something wrong? Here is the full text of my init.d file:

#! /bin/sh
# /etc/init.d/insync-portable

### BEGIN INIT INFO
# Provides: insync-portable
# Required-Start: $remote_fs $syslog $all
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Simple script to start a program at boot
# Description: A simple script from www.stuffaboutcode.com which will start / stop a program a boot / shutdown.
### END INIT INFO

# If you want a command to always run, put it here


# Carry out specific functions when asked to by the system
case "$1" in
        start)
                echo "Starting Insync"
                /home/pi/insync-portable/insync-portable start
                ;;
        stop)
                echo "Stopping Insync"
                /home/pi/insync-portable/insync-portable quit
                ;;
        *)
                echo "Usage: /etc/init.d/insync-portable start|stop"
                exit 1
                ;;
esac


exit 0

I hope this helps troubleshoot the problem.

I’ve edited my file to
cd / cd /home/pi/insync-portable ./insync-portable start cd /

And this still doesn’t seem to work. Any ideas?

@theovenbird I’m not sure but the likely cause is that the user running the init.d script above is the root user while you need to run Insync as your regular user, which is probably pi. You could try using this as your crontab entry: @reboot cd /home/pi/insync-portable && ./insync-portable start.

I tried the crontab entry and that didn’t work, but I did edit the init.d file so that pi and not root ran the command. Here is the updated, working file. Just make sure where it says sudo -u pi to replace pi with your username.

#! /bin/sh
# /etc/init.d/insync-portable

### BEGIN INIT INFO
# Provides: insync-portable
# Required-Start: $remote_fs $syslog $all
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Simple script to start insync-portable
# Description: Will change directory, initialise insync-portable as your user, the change directory back for booting.
### END INIT INFO

# If you want a command to always run, put it here

# Carry out specific functions when asked to by the system
case "$1" in
        start)
                echo "Starting Insync"
                cd /home/pi/insync-portable/
                sudo -u pi ./insync-portable start
                echo "OK"
                cd /
                ;;
        quit)
                echo "Stopping Insync"
                cd /home/pi/insync-portable
                ./insync-portable quit
                cd /
                ;;
        *)
                echo "Usage: /etc/init.d/insync-portable start|quit"
                exit 1
                ;;
esac

exit 0
1 Like

Glad it worked for you. The quit case also needs sudo -u pi then, but otherwise it looks fine.

This crontab command worked for me:

@reboot cd /home/pi/insync-portable && sudo -u pi ./insync-portable start

To verify:
insync-portable get_sync_progress

Remember, to call the insync-portable commands from any location, create the file /usr/bin/insync-portable with the following content:

#!/bin/bash
cd /path/to/client/folder/under/extracted/insync-portable/folder
LC_TIME=C exec ./insync-portable "$@"

Hi guy,
How can I download portable version of insync?

I only can download .deb file which can not be uncompressed

Hi! Can you check this out for me? https://help.insynchq.com/en/articles/112904-linux-insync-on-raspberry-pi