Support

UNiTE, Remote CLI, eXtract Wizard

#3491 Perl script example

Posted in ‘UNiTE and Remote CLI’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

PHP version
n/a
Tool
UNiTE
Tool version
n/a

Latest post by nicholas on Saturday, 02 May 2009 00:53 CDT

user4982
Hello all,

I've just hacked together this perl script example to show you how to trigger backup creation via perl (and download it afterwards via ftp). It at least allows you to natively create (and schedule) backups in OSX (what i use) and linuxen.

Look at the code for configuration options.

Note: this is example code, a lot of stuff isn't implemented yet! This more or less is the first time in years i've dabbled in perl so the code isn;t really good/clean yet.

I plan on making it a multi-site perl backup solution for non-windows users (at some point in time, that is :) ). This means that i'll be updating this at (very) irregular intervals.

Obviously this won;t be supported by the Joomlapack team :)

And of course a few xml-rpc suggestions for the joomlapack team:
- create hash after creating backup, allows for correct download checking
- remove backup after download (saves space on server and prevents joompack backend pollution)

Have fun :)

Matt

nicholas
Akeeba Staff
Manager
Thank you for your submission! I have pulled together a similar thing written in PHP (to be executed by the CLI version of PHP) doing just that. About your notes:

1. Calculating a hash is a time and memory
consuming process. It's the same reason ZIP files appear broken when the "hash" PECL extension isn't present on the host. Since the backups are really, really big files, there is a huge possibility that this step would fail on most hosts. That's why it isn't implemented.

2. Downloading happens in the FTP level so there's nothing to trigger a PHP script (like JoomlaPack) to delete the file when the download is over. However, removing the backup file is easy, with FTP. That's how the upcoming JoomlaPack Remote 2009.2 works and that's how the - again, upcoming - CRON helper script I've pulled together works.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user4982
Hi Nicholas,

I must agree with you on my first suggestion, didn't think of the load it would cause for the server. :)

What I meant with my second suggestion was that, when you remove the backup file with ftp (which i do in the script), the entry is still in the database. This "pollutes" the joomlapack backend with non existing backup entries in the list.

btw, the reason I chose perl in stead of php is that while perl is a more or less standard package in many linux/unix/osx distro's, php rarely is :) .

multi-site version almost ready btw.

user4982
Multi site version :) , uses strict too.

Still no error catching/reporting though.

nicholas
Akeeba Staff
Manager
There is a common misconception that the (ill-named) "Administer Backup Files" page is only there to, uhm, administer backup files. In fact, it's there to keep a record of all backup attempts made with JoomlaPack, no matter if they are successful or not, no matter if the backup file exists or not.

We were thinking of calling it "Statistics", but it would make it difficult to first time users to figure out that they had to click on Statistics to download their backup.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!