Liste des Groupes | Revenir à ol advocacy |
>You ever find the need to write little utility shell scripts, at least?
To do what?
Example: I did one to mirror a selected subset of my programming
projects to my laptop. It only copied project directories that already
existed on the laptop.
>
dir=projects
remote=«main machine»
local=«laptop»
>
if [ $(hostname) != "$local" ]; then
echo "$0: run this on $local" 1>&2
exit 3
fi
>
IFS=$'\n'
flags="-AlprtX"
cd ~/$dir
# first matching rule applies, so put explicit includes before wildcard exclude
rsync ${flags} --delete --verbose \
$(for d in */; do echo --include="/$d"; done) --exclude=/\* \
$remote:$dir/ ./
Les messages affichés proviennent d'usenet.