bsync icon indicating copy to clipboard operation
bsync copied to clipboard

Sync without interactive prompt

Open sultanovich opened this issue 10 years ago • 12 comments

Hi dooblem, I'm Sorry, this is not a issue but I don´t find other method to contact to you. I have one question, is it possible synchronised directories without interactive prompt?. I want to use the cron daemon to automate the synchronization of a directory, but this will not be possible if I have an interactive prompt.

For example:

[root@aest-segu42 apeiti]# /root/bsync -v /home/apeiti/ [email protected]:/home/apeiti

Password:

Loading filelists... Loading original filelist from snap files... Loading .bsync-snap-20140616160929.950125... Loading dir1 filelist... Loading dir2 filelist... Analysing original paths... Analysing remaining new paths in dir1... Analysing remaining new paths in dir2...

(LEFT DIR CONTENT) (RIGHT DIR CONTENT) (ACTION)

                                  <--  A000552.dmp                           (copy)

passwd_acceso1 <-- passwd_acceso1 (sync)

Todo in /home/apeiti/: cp:1 sync:1 Todo in [email protected]:/home/apeiti: Apply actions? [y/N] y

Applying actions... Applying actions in dir2... Applying actions in dir1... rsync: A000552.dmp rsync: passwd_acceso1 Updating filelists... Updating snap files: .bsync-snap-20140616161840.452684... Done! Cleaning SSH master... [root@aest-segu42 apeiti]#

Thanks a lot

sultanovich avatar Jun 16 '14 19:06 sultanovich

Hi, thanks for your feedback. You're right, this could be a useful feature. I'll think about it !!

dooblem avatar Jun 17 '14 07:06 dooblem

Hi dooblem, Why the PR for non-interactive mode isn't accepted yet? If it's only a problem of parameter naming (-n or -b), could you simply accept it and make a revision after? Thanks

Busyvar avatar Jun 27 '15 11:06 Busyvar

Hi Burian,

If you can make the necessary changes I could test the new version in my UNIX lab. If we do this, dooblem only have to review and update the version.

Thanks

sultanovich avatar Jun 28 '15 03:06 sultanovich

Hi guys, I intergrated scstarkey PR, and made the appropriate changes. Can you test it ? Thanks, Marc

dooblem avatar Jun 28 '15 09:06 dooblem

Hi, The Integration testing is working and -b parameter works! ... partially. It fail as expected when there is conflict, but it doesn't say automatically Yes to copy & sync. I don't know how it could be use in a cron job without this behavior; perhaps a parameter like -y (--yes-to-all) is more relevant to describe this? Thanks

Busyvar avatar Jun 28 '15 13:06 Busyvar

Sorry, I didn't see your PR before this message. In my mind we should fix the -b (batch) mode.

dooblem avatar Jul 08 '15 19:07 dooblem

I would also like this. Ideally, it would autoaccept the left branch and create a .conflict file with the right content. This should be relatively simple by making use of rsync's --backup and --suffix= arguments.

jgabriels avatar Oct 29 '15 21:10 jgabriels

See also #23 . We may integrate this kind of solution.

.conflict files would be nice too.

dooblem avatar Feb 18 '16 21:02 dooblem

To fix the problem with the batch-mode change the following code:

Replace the code in line 1025 with the following code:

if noninteractive: resp = "y" else: resp = "non"

This will make accept all changes automatically.

TB1234 avatar Feb 25 '17 09:02 TB1234

thanks @TB1234 fixed and pushed to master. Also added a test case for this bug. Can you test it ? note: the actual behaviour is still to exit on conflicts

dooblem avatar Mar 01 '17 18:03 dooblem

Little bit confused, is there a switch for that? There is no info about in the README.md?

BurtGummer avatar Nov 06 '19 14:11 BurtGummer

Yes, the README has to be updated. Just read the inline help of the command. There is a -b (batch) switch.

dooblem avatar Nov 06 '19 17:11 dooblem