In the past, I'd been using this script ( https://freeandthings.wordpress.com/201 … in-piwigo/ ) to do maintenance on my Gallery on a regular basis.
In my home server setup, I also run Nextcloud, which has a very nice feature - a cron.php file that you can call from a CRON job on your server on a regular basis, and it will do automated tasks for you without needing you to do it by hand (clean up cache, repair & compress the database, etc.).
Would it be possible to create such a file or command, either as a core function of Piwigo or as a plugin, so that a CRON job can be scheduled to run on the Piwigo system on a regular basis? This could be used to do things like:
- Generate missing thumbnails
- Optimize the database
- Clear the cache
Thank you!
Offline
Any update on this? I need to have something that can automatically run the maintenance that I am having to do manually on a daily basis just to keep the disk space usage under what my host allows.
Please, this is needed ASAP.
Offline
Yes, I have news on this. Linty is preparing a "Piwigo CLI". Oh yes, you read it right!
Linty can you tell us more about what's planned?
Offline
Hello,
We are currently developing "Piwigo CLI", which will initially be released as a plugin. The goal is to allow users to manage their Piwigo as much as possible via the command line. With Plg, we have agreed for now to add simple management commands such as "list, add, edit and delete" for users, tags, albums, etc.
As well as all the actions in the Maintenance tab, if possible. That’s our goal, and everything is being developed so that these commands can be used in scripts or cron jobs.
I think you’ll be able to test it before the end of August! Feel free to reply here if you have any ideas for commands to add that would be useful for managing Piwigo
Offline
Linty wrote:
for now to add simple management commands such as "list, add, edit and delete" for users, tags, albums, etc.
For me, that's not the most important actions. Priorities are "maintenance" actions + sync + generate multiple sizes.
Linty wrote:
[...] before the end of August!
Wow, that's short term!
Offline
Hi,
Linty wrote:
Feel free to reply here if you have any ideas for commands to add that would be useful for managing Piwigo
Maybe a search filter like in the batch manager?
Will there be a pipe mechanism?
Last edited by polowigo (2026-08-23 08:35:02)
Offline
Linty wrote:
I think you’ll be able to test it before the end of August
Couldn't wait to try ;)
Offline
Hello,
It’s not the end of August, but rather mid-September. However, yesterday I released an initial version of "Piwigo CLI" on PEM. You can test and install the plugin directly via your Piwigo admin panel (https://piwigo.org/ext/index.php?eid=1113).
This initial version includes:
- global shortcut (a command to use "pwg <command> [options]")
- doctor and status: diagnose the server and the gallery using statistics
- install, update, upgrade and backup
- import: a directory of photos, with its folders becoming albums
- album, photo, user: list, add, edit, move, delete...
- plugin and theme management: with search from piwigo.org/ext
- maintenance and purge
- --help with examples, --dry-run and --format=json for all commands
Offline
Thank you, Linty!
So no syncronization command yet?
Offline
neon wrote:
So no syncronization command yet?
Not yet. It will come with Piwigo 17. We need to change a few functions in the core so the CLI can use the sync, and fix some bugs in the sync itself.
What we have today (in cli) is import, which takes a directory tree and uploads it, its folders becoming albums. But It is not the sync as Piwigo has always known it.
Offline