Dave Warren | 1 Mar 02:33 2012

Automatically clean up .unison.*.tmp files

Is there any way to have Unison automatically clean up it's own .tmp files?

I've got a ton of them getting left behind when a synchronization is 
interrupted, and they fulfill their purpose nicely. However, I'd love to 
get rid of them once a subsequent synchronization completes successfully.

Is there anything in unison that can help me or do I need to script a 
solution outside of unison?

-- 
Dave Warren, CEO
Hire A Hit Consulting Services
http://www.hireahit.com/
http://ca.linkedin.com/in/davejwarren

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/unison-users/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/unison-users/join
    (Yahoo! ID required)

<*> To change settings via email:
(Continue reading)

Benjamin C. Pierce | 1 Mar 02:54 2012

Re: Automatically clean up .unison.*.tmp files

Unison should clean up .tmp files after 30 days.

   - B

On Feb 29, 2012, at 8:33 PM, Dave Warren wrote:

> Is there any way to have Unison automatically clean up it's own .tmp files?
> 
> I've got a ton of them getting left behind when a synchronization is 
> interrupted, and they fulfill their purpose nicely. However, I'd love to 
> get rid of them once a subsequent synchronization completes successfully.
> 
> Is there anything in unison that can help me or do I need to script a 
> solution outside of unison?
> 
> -- 
> Dave Warren, CEO
> Hire A Hit Consulting Services
> http://www.hireahit.com/
> http://ca.linkedin.com/in/davejwarren
> 
> 
> 
> 
> ------------------------------------
> 
> Yahoo! Groups Links
> 
> 
> 
(Continue reading)

Dave Warren | 1 Mar 03:11 2012

Re: Automatically clean up .unison.*.tmp files

Is that configurable or is the 30 day window hardcoded?

In case there's a better approach, my underlying problem is that I have a nightly backup of our file server to an offsite location and I'm billed per MB (transferred and stored). We had a set of files that totaled 14GB (of 16GB) that a user accidentally synchronized to a shared folder on the file server, the user noticed and killed unison hoping to save us some backup charges. The user then deleted the files at the source (unaware of the .tmp files on the other end) and synchronized again, leaving 14GB worth of junk on the backup directory.

Ironically had the user not attempted to kill unison, they could have cleaned up after themselves, but they meant well.

I realize the utility of being able to resume from incomplete files, but could unison safely assume that once a subsequent sync completes successfully, the temp files can be removed?

Unfortunately I can't exclude these tmp files from the backup job in a uniform way due to limits in the backup software. I'm independently working on addressing that problem, but it's not looking like a quick fix will be forthcoming.


On 2/29/2012 5:54 PM, Benjamin C. Pierce wrote:
 

Unison should clean up .tmp files after 30 days.

- B

On Feb 29, 2012, at 8:33 PM, Dave Warren wrote:

> Is there any way to have Unison automatically clean up it's own .tmp files?
>
> I've got a ton of them getting left behind when a synchronization is
> interrupted, and they fulfill their purpose nicely. However, I'd love to
> get rid of them once a subsequent synchronization completes successfully.
>
> Is there anything in unison that can help me or do I need to script a
> solution outside of unison?




__._,_.___

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___
Benjamin C. Pierce | 1 Mar 04:48 2012

Re: Automatically clean up .unison.*.tmp files

Is that configurable or is the 30 day window hardcoded?

It's hardcoded, but it wouldn't be hard to make it an option.  Or to compile up a custom version for yourself with a smaller window.  The relevant code is in the function childrenOf in os.ml.

In case there's a better approach, my underlying problem is that I have a nightly backup of our file server to an offsite location and I'm billed per MB (transferred and stored). We had a set of files that totaled 14GB (of 16GB) that a user accidentally synchronized to a shared folder on the file server, the user noticed and killed unison hoping to save us some backup charges. The user then deleted the files at the source (unaware of the .tmp files on the other end) and synchronized again, leaving 14GB worth of junk on the backup directory.

Ironically had the user not attempted to kill unison, they could have cleaned up after themselves, but they meant well.

I realize the utility of being able to resume from incomplete files, but could unison safely assume that once a subsequent sync completes successfully, the temp files can be removed?

I'm not 100% certain this would work -- we'd need to double-check exactly how the temp files are handled -- but it seems plausible.  Would take a tiny bit of work, because at the moment the deletion of the temp files is happening at a very low level, disconnected from the synchronization logic, but no rocket science.

Not sure if this should be the default behavior, though -- there are lots of imaginable situations where deleting the temp files early would be a shame (e.g., I successfully synchronize just one path in a large directory tree, and suddenly all the temp files elsewhere in the tree get deleted).

Another simple thing to do would be to a dd a "-purgetempfiles" switch.  Then whoever was running Unison could notice whether the previous run succeeded and run again with this switch.

    - Benjamin



Unfortunately I can't exclude these tmp files from the backup job in a uniform way due to limits in the backup software. I'm independently working on addressing that problem, but it's not looking like a quick fix will be forthcoming.


On 2/29/2012 5:54 PM, Benjamin C. Pierce wrote:
 

Unison should clean up .tmp files after 30 days.

- B

On Feb 29, 2012, at 8:33 PM, Dave Warren wrote:

> Is there any way to have Unison automatically clean up it's own .tmp files?
>
> I've got a ton of them getting left behind when a synchronization is
> interrupted, and they fulfill their purpose nicely. However, I'd love to
> get rid of them once a subsequent synchronization completes successfully.
>
> Is there anything in unison that can help me or do I need to script a
> solution outside of unison?





__._,_.___

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___
David J. Haines | 1 Mar 21:39 2012
Picon

~/unison.log created despite options to the contrary

Hi all,

I'm using unison 2.40.63 on an Arch Linux "client" and a Mac OS X 10.6
"server" via the following command line in a crontab:

/usr/bin/unison -batch -silent -log=false -logfile /home/dhaines/.unison/logfile -servercmd
/opt/local/bin/unison $HOME/Sync ssh://<OSX Host>/Sync

Oftentimes while syncing, I get the "Fatal Error Lost connection with the server"
error, which I understand is related to ssh timeouts. Though that is a
problem (and I'd gladly accept any help people are willing to give on
it), my biggest issue is that said Fatal Error keeps appearing in
"unison.log" in my $HOME, despite my use of the -silent, -log=false, AND
-logfile /home/dhaines/.unison/logfile options.

Really, I'm willing to put up with the Fatal Error business, but not
being able to direct the logfile elsewhere is driving me mad. Does
anyone have any suggestions?

Thanks,

-- 
David J. Haines
djhaines <at> gmx.com

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/unison-users/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/unison-users/join
    (Yahoo! ID required)

<*> To change settings via email:
    unison-users-digest <at> yahoogroups.com 
    unison-users-fullfeatured <at> yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    unison-users-unsubscribe <at> yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Re: ~/unison.log created despite options to the contrary

Sorry I can't answer your main question about the log file (actually I have a cron script that runs unison and then moves the log file (and renames it) after unison runs, if that is a suitable workaround), but for the ssh timeout, I use the following option that keeps that from happening: -sshargs '-o ServerAliveInterval=60'

Hope that helps.

Mike E.


On Thu, Mar 1, 2012 at 3:39 PM, David J. Haines <djhaines <at> gmx.com> wrote:
 

Hi all,

I'm using unison 2.40.63 on an Arch Linux "client" and a Mac OS X 10.6
"server" via the following command line in a crontab:

/usr/bin/unison -batch -silent -log=false -logfile /home/dhaines/.unison/logfile -servercmd /opt/local/bin/unison $HOME/Sync ssh://<OSX Host>/Sync

Oftentimes while syncing, I get the "Fatal Error Lost connection with the server"
error, which I understand is related to ssh timeouts. Though that is a
problem (and I'd gladly accept any help people are willing to give on
it), my biggest issue is that said Fatal Error keeps appearing in
"unison.log" in my $HOME, despite my use of the -silent, -log=false, AND
-logfile /home/dhaines/.unison/logfile options.

Really, I'm willing to put up with the Fatal Error business, but not
being able to direct the logfile elsewhere is driving me mad. Does
anyone have any suggestions?

Thanks,

--
David J. Haines
djhaines <at> gmx.com




__._,_.___


Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___
Adrian Klaver | 1 Mar 22:16 2012
Picon

Re: ~/unison.log created despite options to the contrary

On Thursday, March 01, 2012 12:39:45 pm David J. Haines wrote:
> Hi all,
> 
> I'm using unison 2.40.63 on an Arch Linux "client" and a Mac OS X 10.6
> "server" via the following command line in a crontab:
> 
> /usr/bin/unison -batch -silent -log=false -logfile
> /home/dhaines/.unison/logfile -servercmd /opt/local/bin/unison $HOME/Sync
> ssh://<OSX Host>/Sync
> 
> Oftentimes while syncing, I get the "Fatal Error Lost connection with the
> server" error, which I understand is related to ssh timeouts. Though that
> is a problem (and I'd gladly accept any help people are willing to give on
> it), my biggest issue is that said Fatal Error keeps appearing in
> "unison.log" in my $HOME, despite my use of the -silent, -log=false, AND
> -logfile /home/dhaines/.unison/logfile options.
> 
> Really, I'm willing to put up with the Fatal Error business, but not
> being able to direct the logfile elsewhere is driving me mad. Does
> anyone have any suggestions?

Eliminate the -log=false . The -logfile switch should be enough to redirect your 
messages:

http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-
manual.html#prefs
"
logfile xxx
By default, logging messages will be appended to the file unison.log in your HOME 
directory. Set this preference if you prefer another file.
"

> 
> Thanks,

-- 
Adrian Klaver
adrian.klaver <at> gmail.com

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/unison-users/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/unison-users/join
    (Yahoo! ID required)

<*> To change settings via email:
    unison-users-digest <at> yahoogroups.com 
    unison-users-fullfeatured <at> yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    unison-users-unsubscribe <at> yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Alan Schmitt | 2 Mar 10:03 2012

Re: ~/unison.log created despite options to the contrary

On 1 mars 2012, at 22:16, Adrian Klaver wrote:

> Eliminate the -log=false . The -logfile switch should be enough to redirect your 
> messages:
> 
> http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-
> manual.html#prefs
> "
> logfile xxx
> By default, logging messages will be appended to the file unison.log in your HOME 
> directory. Set this preference if you prefer another file.
> "

You could also try: "-logfile /dev/null".

Alan

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/unison-users/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/unison-users/join
    (Yahoo! ID required)

<*> To change settings via email:
    unison-users-digest <at> yahoogroups.com 
    unison-users-fullfeatured <at> yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    unison-users-unsubscribe <at> yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Benjamin C. Pierce | 3 Mar 16:40 2012

Re: ~/unison.log created despite options to the contrary

I'm afraid I don't see what's wrong here.  It's true that the -log and -logfile preferences are set by default
to values that would cause this behavior *if* Unison crashed immediately after startup, but once the
options have been parsed they should be set to the values you asked for.

    - B

On Mar 2, 2012, at 4:03 AM, Alan Schmitt wrote:

> On 1 mars 2012, at 22:16, Adrian Klaver wrote:
> 
>> Eliminate the -log=false . The -logfile switch should be enough to redirect your 
>> messages:
>> 
>> http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-
>> manual.html#prefs
>> "
>> logfile xxx
>> By default, logging messages will be appended to the file unison.log in your HOME 
>> directory. Set this preference if you prefer another file.
>> "
> 
> You could also try: "-logfile /dev/null".
> 
> Alan
> 
> ------------------------------------
> 
> Yahoo! Groups Links
> 
> 
> 

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/unison-users/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/unison-users/join
    (Yahoo! ID required)

<*> To change settings via email:
    unison-users-digest <at> yahoogroups.com 
    unison-users-fullfeatured <at> yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    unison-users-unsubscribe <at> yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Benjamin C. Pierce | 3 Mar 19:26 2012

Re: ~/unison.log created despite options to the contrary

Nope.  The -log setting controls whether anything happens at all; the -logfile setting controls where it
happens, if so.

On Mar 3, 2012, at 1:10 PM, Adrian Klaver wrote:

> On Saturday, March 03, 2012 7:40:21 am Benjamin C. Pierce wrote:
>> I'm afraid I don't see what's wrong here.  It's true that the -log and
>> -logfile preferences are set by default to values that would cause this
>> behavior *if* Unison crashed immediately after startup, but once the
>> options have been parsed they should be set to the values you asked for.
> 
> So -log=false with  -logfile /home/dhaines/.unison/logfile would not be sending 
> mixed signals?
> 
>> 
>>    - B
> 
> 
> -- 
> Adrian Klaver
> adrian.klaver <at> gmail.com

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/unison-users/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/unison-users/join
    (Yahoo! ID required)

<*> To change settings via email:
    unison-users-digest <at> yahoogroups.com 
    unison-users-fullfeatured <at> yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    unison-users-unsubscribe <at> yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/


Gmane