Time rsYnc Machine (tym)

M. Carrasco ca at dragoman.org
Thu Jul 26 15:56:04 MDT 2012


You know programmers are not very good at documenting :-)

On 26 Jul 2012, at 21:42, josephj at main.nc.us wrote:

> No good deed goes unpunished ;)
> Very nicely coded script, but it's a bit dense.  I'm good at bash and can
> survive in rsync,

My intention was to make something readable :-) 

Main () {
 Bye 0

I will *try* to illustrate the code, but, please point to the most obscure bits and I will concentrate on it.

> but could you provide a description of what it actually
> does so I don't have to spend a long time analysing the code?

Similar functionalities to the Time Machine, though nothing for restoring: one has to use the available copy commands.

> Does it keep multiple versions like the name implies?

Yes. As indicated in

"each run creates two yymmdd-hhmmss directories, one in the backup destination directory and one in the log directory"

 - /foo/bar-dest (the data, using the hard link mechanism of rsync)

 - ~./tym (the logs)

Each log directory contain four files:
 log.txt    : then main log of Tim
 rsync.txt  : the output of rsync
 out.txt    : the standard output; should be empty
 err.txt    : the standard error; should be empty

The file log.txt 

Where the fields are:
 sequential number
 seconds into the program

> Will it survive directory names with embedded blanks (in the parameters)?

Probably not. The variable SourceList should contain strings that survive Linux and rsync

 rsync ... $SourceList

> Why trap so many signals?  If something goes wrong, do I have to kill -9
> to stop it?

I trap all the signals because I want to know all the signals received. If tym receives a signal it log it in log.txt and continue; it might be changed to do something else.

I was considering changing it, so one could kill it with SIGTERM; the PID could be logged into log.txt.

> Does one of those keep it running when you logoff?  I don't see a nohup in
> the script.

It will keep running after logoff as SIGHUP is also trapped.

> I've seen some methods that use hard links to make subsequent backups
> smaller.  I haven't quite figured out how that works, but it doesn't look
> like you use it.

The hard work is done by rsync; tym is just a wrap. Indeed, it should not be too hard to implement it in rsync
 "One might consider implementing time machines facilites in rsync: --tm-source --tm-dest --tm-logdir --tm-machine"

> What does your script do if the destination runs out of space or isn't
> mounted?

It will fail and the errors registered in the appropriate logs.


> Joe
>> http://dragoman.org/tym
>> Regards
>> Tomas
>> --
>> 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

More information about the rsync mailing list