link project folder to dropbox folder using linux

Viewed 69

I want to share the project with others to develop faster so I decided to link the project directory to the Dropbox using Linux but when I create a link folder from Dropbox to my project it's not working and I can't import libraries.

how can I link a folder from Dropbox into my project folder and import libraries?

1 Answers

of course its better for you to use git instead, but you can do it by some simple command named rsync.

rsync can use for remote sync or local sync.

 
case "$1" in
    start)
        process_id=`ps -aux | grep "synchronize_script" | grep -v "grep" | awk '{print $2}' | awk 'END{ print NR }'`;
        tolerable=3;
        if [ $process_id -ge $tolerable ]
        then
            echo "synchronize_script already started !!!";
        else
            while true; do
                sleep 3;
        rsync -az --delete /PathToProjectSource/SpecificFolder1/  /PathToProjectDestination/TheSameSpecificFolder1/;
            # YOU CAN ADD SpecificFolders AS MANY AS YOU WANT BY ADDING ANOTHER LINE LIKE ABOVE INTO WHILE LOOP.
            done &
            echo "started"
        fi
        ;;
    stop)
        process_id=`ps -aux | grep "synchronize_script" | grep -v "grep" | awk '{print $2}' | awk 'END{ print NR }'`;
        tolerable=2;
        if [ $process_id -eq $tolerable ]
        then
            echo "no synchronize_script started yet";
        else
            kill -9 `ps -aux | grep "synchronize_script" | grep -v "grep" | awk '{print $2}'`
        fi
        ;;
    *)
        echo $"Usage: $0 { start | stop }"
esac

here is the link of my script using rsync and dropbox.

github/mahdifox

Related