Re: rsync
Hello,
> Question about rsync
>
> Say I want rsync to synchronize a directory. If I delete a file from
> the source directory, however, I've noticed that it leaves the file in
> the destination directory. Is there a parameter to force it to remove
> files that are not present in the source? (This would seemingly
> contradict the first criteria, i.e., you can't have both.)
yes, it would be "--delete --delete-after"
I'm including a sample rsync config file below with the delete-after
in context.
## ---------------------------------------------------------------------- ##
# 14oct2000 -- sereciya
#
# rsyncMakefile.example
#
#HOST?=sereciya@somehost.net
#DESTDIR?=$(HOST):/home/sereciya
#pull:
# rsync $(DRY_RUN) $(RSYNCSPEC) --verbose --progress --rsh ssh \
# --exclude *.o \
# --exclude a.out \
# --exclude core \
# --delete --delete-after \
# --archive $(DESTDIR)/ .
#push:
# rsync $(DRY_RUN) $(RSYNCSPEC) --verbose --progress --rsh ssh \
# --exclude *.o \
# --exclude a.out \
# --exclude core \
# --exclude rsync* \
# --delete --delete-after \
# --archive . $(DESTDIR)
#pullnew:
# rsync $(DRY_RUN) $(RSYNCSPEC) --verbose --progress --rsh ssh \
# --exclude *.o \
# --exclude a.out \
# --exclude core \
# --archive $(DESTDIR)/ .
# copys newly changed local files to the remote location.
#pushnew:
# rsync $(DRY_RUN) $(RSYNCSPEC) --verbose --progress --rsh ssh \
# --exclude *.o \
# --exclude a.out \
# --exclude core \
# --archive . $(DESTDIR)
## ---------------------------------------------------------------------- ##
Hope this helps...
You're welcome in advance,
--Sêrêciya Kurdistanî
--
+--------------------------------------------------------------+
| Welat xwe ava nake, dest bidin hevdu, pist nedin tu dijminî |
| Riya azadiyê ne hêsan e, hêviya xwe bernedin, dema me |
| nêzîk e. |
| |
| Hevaltî bi kesên du rû nekin, hevaltî bi hevdu ra bikin |
| Ne ji hevaltiya wan kesên pêxwas û rû dirêj, ne bi wan |
| kesên xwînperest, ne jî ji yên din. |
| |
| -Sêrêciya Kurdistanî |
+--------------------------------------------------------------+
translation provided on request: sereciya@kurdistan.ath.cx
Reply to:
- References:
- rsync
- From: Curtis Vaughan <curtis@npc-usa.com>