On limited devices rsync gets out of RAM while crawling the FileSystem, so I decided to script this and to transfer each directory individually and exclude successfully transferred on second pass.
But 1st I needed to know how to copy a single dir without changing the argument of destitation (ie: not /src/subdir to /dest/subdir , just copy subdir from /src/ to /dest/)
And ended with this solution:
dir="/tmp/$0.dir/base" src="$dir/src" dst="$dir/dst" rm -rfv "$dir" mkdir -p "$src" "$dst" cd "$dir" pwd mkdir -p dir/subdir touch dir/subdir/file mkdir -p tmp mkdir -p dir/ignored-1 mkdir -p dir/ignored-2 mkdir -p dir/ignored-3 mkdir -p dir/ignored-4 dir="dir/subdir" filters=() d="$dir" while [ "." != "$d" ] ; do filters+=(--filter '+ '$d'/') d=$(dirname -- "$d") done IFS=$'\n'; success="$dir/done.lst" touch "$success" sudo rsync \ --verbose \ -aAvxXm \ --exclude-from "$success" \ --filter "+ $dir/**" \ "${filters[@]}" \ --filter '- *' \ "./" "$dst/" \ && echo "$dir" | tee -a "$success" find "$dst" sudo rsync \ --verbose \ -aAvxXm \ --exclude-from="$success" \ --filter "+ $dir/**" \ "${filters[@]}" \ --filter '- *' \ "./" "$dst/" \ && echo "$dir" | tee -a "$success" rm -rf "$dir"
I rebuilt this neat rsync tool for my HandSet … I planned to publish it on ovi store too but I miss a gui, so i created a basic qt using python … but It is not over anyway the package freely installable from shared repo …
TopStream: http://rsync.samba.org/# VC: http://gitweb.samba.org/?p=rsync.git
UpStream: http://packages.qa.debian.org/r/rsync.html
DownStream: https://gitorious.org/downstream/rsync
Just open this file on your device browser's :
Or updated one at :
http://repo.pub.meego.com/home:/rzr:/harmattan/MeeGo_1.2_Harmattan_Maemo.org_MeeGo_1.2_Harmattan_standard/armel/# rsync_3.0.9-1.0~rzr1_armel.deb
Using ApT see http://rzr.online.fr/q/harmattan
upcoming ovistore : http://store.ovi.com/content/265132#
Status :
https://build.pub.meego.com/package/show?package=rsync&project=home%3Arzr%3Aharmattan