rsync with --backup - Tools

This is a discussion on rsync with --backup - Tools ; Hello Guys, i'm new to rsync.. and i have a request to fix some things(not related to rsync)... and i could not find and good-for-me examples on the net.. here is the deal: we have an ant-script.. that uses rsync ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: rsync with --backup

  1. rsync with --backup

    Hello Guys,

    i'm new to rsync.. and i have a request to fix some things(not
    related to rsync)... and i could not find and good-for-me examples on
    the net..
    here is the deal: we have an ant-script.. that uses rsync to
    update our server's files.. i.e. patch-script
    and request is.. to save files, that are updated...
    and when the patch-script is run again (like, the same one)
    back-ups must not be overwritten.

    in rsync i've found --backup and --backup-dir...
    but the thing is.. that i need to store backups on local station
    (it is simplier to me),
    not on the receiving side... (as backup-dir option tries to do)

    giving --filter='Pp *~' after --backup-dir gives me
    --filter=Pp *~: unknown option

    and
    --backup-dir='user@host1:/path/to/backupdir/' /local/path/ user@host2:/remote/path/
    gives no results.. files are updated, but no backups .. ("user"
    are the same on both servers)

    i could try to store back ups on host2, then tar them and the copy
    them back to host1...

    or at first rsync modified file between two hosts to host1 (i.e. make
    backup manually)
    and then rsync to host2

    any ideas?

    version of rsync is 2.6.3 v 28 (and i can not change it.)

    --
    Best regards,
    Paul 'Spawn' Rysevets P.Rysevets@sam-solutions.net
    SpAwN_gUy.aka.WAREZMasta WAREZMasta@gmail.com
    ICQ:968978 SKYPE-ID: spawn_guy

    --
    Please use reply-all for most replies to avoid omitting the mailing list.
    To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
    Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


  2. Re: rsync with --backup

    On Thu, 2008-09-04 at 13:46 +0300, Paul -Spawn- Rysevets wrote:
    > here is the deal: we have an ant-script.. that uses rsync to
    > update our server's files.. i.e. patch-script
    > and request is.. to save files, that are updated...
    > and when the patch-script is run again (like, the same one)
    > back-ups must not be overwritten.
    >
    > in rsync i've found --backup and --backup-dir...
    > but the thing is.. that i need to store backups on local station
    > (it is simplier to me),
    > not on the receiving side... (as backup-dir option tries to do)
    >
    > giving --filter='Pp *~' after --backup-dir gives me
    > --filter=Pp *~: unknown option


    Rsync 2.6.3 is too old to understand that option, but in any event, it
    would only protect backups from deletion, not from overwriting if the
    same destination file is updated again.

    > and
    > --backup-dir='user@host1:/path/to/backupdir/' /local/path/ user@host2:/remote/path/
    > gives no results.. files are updated, but no backups .. ("user"
    > are the same on both servers)


    You have to pass --backup too. --backup-dir does not by itself enable
    backups; it only modifies the behavior of backups. In addition,
    --backup-dir only supports a directory on the receiver; it cannot send
    backups back to the sender.

    > i could try to store back ups on host2, then tar them and the copy
    > them back to host1...


    This is what I would do, except I would use rsync instead of tar to pull
    the backups. For example:

    DATE=$(date +%Y%m%d)
    rsync -a --backup --backup-dir=/remote/backups/$DATE/ \
    /local/path/ user@host2:/remote/path/
    rsync -a user@host2:/remote/backups/$DATE/ /local/backups/$DATE/

    > or at first rsync modified file between two hosts to host1 (i.e. make
    > backup manually)
    > and then rsync to host2


    That would also work. If you like, you could have the second run apply
    a batch file written by the first run instead of rereading the source.

    Matt

    --
    Please use reply-all for most replies to avoid omitting the mailing list.
    To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
    Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.9 (GNU/Linux)

    iEYEABECAAYFAkjABmIACgkQC+xSYN/RlfvpHACgop4qWu3yYp1HNiIxaeoFWlCh
    BJMAmwSyUNOLH32t58qdSmuXEsdwvN4c
    =GWcw
    -----END PGP SIGNATURE-----


+ Reply to Thread