RSYNC for QL?

Anything QL Software or Programming Related.
Post Reply
Silvester
Gold Card
Posts: 436
Joined: Thu Dec 12, 2013 10:14 am
Location: UK

RSYNC for QL?

Post by Silvester »

For those who don't know RSYNC is a very useful utility on Linux which synchronises two file systems (or directories, even across the internet). It will add/delete/update files to make them exactly the same. You can even do a dummy run, where it will output a list of the actions it would take it - very crucial - as a tool it is a very sharp knife. :twisted:

Do we already have something similar for the QL that would also work across the QL net ?

What I would really like is something very similar to RSYNC (command line task) where you can get a list of actions taken (including dummy run). Prepared to write it myself if D0.L=ERR_NI. :geek:


David
Derek_Stewart
Font of All Knowledge
Posts: 4684
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: RSYNC for QL?

Post by Derek_Stewart »

Hi,

I do not think there is anything like RSYNC, but Thierry Godefroy, wrote a programme called: RSHELL to administer his BBS over the phone line.

The software is on Dilwyn's web site:

http://www.dilwyn.me.uk/internet/rshell104.zip

Maybe this could be adapted...


Regards,

Derek
User avatar
tofro
Font of All Knowledge
Posts: 3094
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: RSYNC for QL?

Post by tofro »

Nope. No RSYNC for the QL, not to my knowledge. (As RSYNC is mainly based on TCP/IP, you'd have a hard time implementing it on the Black Box anyways ;) ).
RSYNC's unique feature is it transmits only diffs between file systems, something that's probably hardly worth the effort given the QL's average file size.

Something that could be worth looking into for this purpose, is IMHO Backup by Wolfgang Lenerz, TGBackup by Thierry Godefroy, or NorBack (all from Dilwyn's site, all support incremental backups).

If you'd be using a backup program to sync file systems, you'd have to 2-way sync (i.e. from source to destination and then back). This works well on QPC2 and uqlx (probably also QEmu - That I don't use) where the remote drive can be another QPC2's win image mounted over the network.

I don't normally invest so much work: I have one "Master" QPC2 file system of ~1GB that I simply push over the (windows/Samba/OS/2) networkto remote emulators (QPC2, uqlx) and QXL computer.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
dilwyn
Mr QL
Posts: 3065
Joined: Wed Dec 01, 2010 10:39 pm

Re: RSYNC for QL?

Post by dilwyn »

No RSYNC as fair as I know, but there is a SYNC program, written in BASIC, on my website's Files page:

http://www.dilwyn.me.uk/files/index.html

(scroll down to 'Sync')

It's only a local file synchroniser, but written in BASIC and fairly easy to understand. Was written some time ago, so don't remember that much about writing it but I do use it from time to time myself, might provide the "core" of a program to save reinventing the wheel if you are prepared to adapt it to do what you want. Feel free to use/adapt the source.


Silvester
Gold Card
Posts: 436
Joined: Thu Dec 12, 2013 10:14 am
Location: UK

Re: RSYNC for QL?

Post by Silvester »

Thanks for the pointers to existing software. None of them really do what I want in the way I need to be able to do it.

Regarding RSYNC, yes it does a great deal more than required - I just use the (almost incidental) local backup facility. Like many others I was put off using it intially because it looked unnecessarily complex and esoteric. (The facility of only sending the differences doesn't apply when file sysytems are local). As you mention, QL files are small and even over slow NET its not worth effort for a QL RSYNC at each end. The TCP/IP stuff was way beyond anything being considered.

I want something that can be used on any of my QL platforms (from a BB QL with dual FLPs up to a Q40). A very small m/c EX utility (ie. not dependent on OS extensions - apart from perhaps NET if required). What is crucial is to be able to output simple text of actions proposed/taken. Because of the reiterative nature of the task it could be very small indeed. One of the things I spent a bit of time with Photon was ensuring it worked on _everything_ (you can if you wish, view a jpeg on a 128K BB QL, albeit very small jpeg). I'm easily put off utility software that has esoteric requirements or unnecessarily does more that I want in a way I find difficult to use or remember on the occasions I use it.

OK, it's now something on my list of things to do. I just wondered if something existed but escaped me (often done). Another on my wish list is QPAC2 Files handling directories better (ie. Delete, Move, Copy etc, as with it does with files).

PS: ... but escaped me (often done). :!:
Dilwyn, will have look at your program.


David
Silvester
Gold Card
Posts: 436
Joined: Thu Dec 12, 2013 10:14 am
Location: UK

Re: RSYNC for QL?

Post by Silvester »

Dilwyn, the doc with your sync program struck a chord with me - I have fell foul of the same thing ;-)

I like your idea of two-way syncing, it deals nicely with the problem you described. It certainly solves the problem of potentially losing stuff updated on one but not the other. But my bad habits would get me into a right mess (I am constantly shifting files/directories around until they settle in a place where I can most often find them. On my Linux systems rsync then has to do a lot of deletes/recreates, understandably, it doesn't 'move' stuff).

For a basic program yes, I could easily adapt it :-) Once the model proves reliable it could be written in machine code. (I never would have got jpeg done without having written something in basic first - it took hours to do one image!). Decoding GIF in basic first illustrated a potential problem I then discovered Carlos had fallen foul of in his UNGIF, it creates massive hashing table if try to decode a plain single colour image (crashes QL).

Basic prototypes are great for solving such unexpected conditions, or most often, understanding failings in technical documentation ('Oh, you meant this!'). It just would be handy to have a some better bit manipulation keywords, they are usually the part that take the most time in basic.


David
User avatar
dilwyn
Mr QL
Posts: 3065
Joined: Wed Dec 01, 2010 10:39 pm

Re: RSYNC for QL?

Post by dilwyn »

Silvester wrote:Dilwyn, the doc with your sync program struck a chord with me - I have fell foul of the same thing ;-)
Why do you think I wrote it... :oops:

Written to do a specific job, and turned out quite useful for me.
Silvester wrote:Basic prototypes are great for solving such unexpected conditions, or most often, understanding failings in technical documentation ('Oh, you meant this!'). It just would be handy to have a some better bit manipulation keywords, they are usually the part that take the most time in basic.
I've written enough graphical routines myself to strongly agree with you about the bit manipulation keywords. Graphical code relies so much on shifting, rotating, masking and manipulating bits within bytes/words/long words that it quickly becomes slow and tedious from BASIC, although I'd also agree that writing test code in BASIC first before starting on machine code can be helpful.


Post Reply