This script copies all data from /data/data to any directory(in sdcard) and (soft)links back them in /data/data.
The purpose is to free space from /data/data.
To use it, first make sure the DESTDIR exists, change it according to your need, mkdir it. here i used /data/sdext2 which is a ext partition on sdcard mounted by link2sd.
make sure your android is rooted and you have cp,rm,ln binary installed, usually these come from busybox.
copy the script to android,