Pickle
Mega GP Mania
Ive been trying to work this out, but its not working. Im trying to setup my GCW packages similar to my pnds. I put modifiable files into a folder called default. These files are copied to some location on the local fileystem, only if a file doesnt already exist.
GCW uses busybox for command implementation and it really is the bare minimum. Pandora GNU cp has a -no-clobber option which works great. Busybox cp and mv do have interactive modes....that dont work.
So im trying to use bash test arguments to detect folders and files to recursive copy my folder. So calling out there to script experts to show me the way if possible. Im open to alternative, if another command can do it ill try it (ive tried some things with rsync too).
GCW uses busybox for command implementation and it really is the bare minimum. Pandora GNU cp has a -no-clobber option which works great. Busybox cp and mv do have interactive modes....that dont work.
So im trying to use bash test arguments to detect folders and files to recursive copy my folder. So calling out there to script experts to show me the way if possible. Im open to alternative, if another command can do it ill try it (ive tried some things with rsync too).
Code:
copyfiles()
{
for file in $1/*; do
echo "Checking $file"
if [ -d $file ]; then
echo " detected Directory"
copyfiles $file $2
else
if [ -f $2/$file ]; then
echo " Copy not writing $2/$file"
else
echo " Copy writing $2/$file"
cp $1/$file $2/$file
fi
fi
done
}
echo "Checking local files"
copyfiles default ${HOME}