I'm using RARLABS RAR.exe to archive/backup my server data. I am familiar with using RAR for creating an archive and adding files from a folder, but what about streaming data directly into an archive?
For example, when backing up my MySQL databases I use the mysqldump command that includes a pipe command into a text file. It would be nice to skip the file step and go directly into an archive file using something like the following syntax:
mysqldump -uUserName -pPassword --all-databases > rar.exe newarchivename.rar
Does anyone know if what I have described, or something similar, is even possible?
Best Answer
I contacted RARLabs support and recieved a response. It turns out that RAR.EXE can handle streaming input similar to how gzip works. You just need to specify the -si option:
Why would I want to use RAR instead of GZIP? Well one thing GZIP doesn't have is the ability to automatically include a date stamp on the file name.
So with this info here is an example of how I will be backing up the MySQL database information:
Which creates an archive file that looks similar to the following name:
and contains a single file:
Pretty cool...