Announcement

#1 2021-06-03 13:13:40

benji
Member
2021-05-28
2

[resolved] Auto Synchronize

Hi All,

Just wondering if there is a way to auto sync my albums every 5 mins or so? I couldn't find any plugins or extensions.
The Quick Local Synchronization works perfectly, but i just don't want to have to log in to synchronize the albums.

The reason for this is I have many timelapse cameras uploading images to their respective albums on my server and would like to automate this.

Apart from that one issue, Piwigo is unreal!

My Environment:
Piwigo 11.5.0 Check for upgrade
Operating system: Linux
PHP: 7.4.3 (Show info) [2021-06-03 11:07:22]
MySQL: 8.0.25-0ubuntu0.20.04.1 [2021-06-03 11:07:22]
Graphics Library: ImageMagick 6.9.10-23

Any help would be awesome!
Cheers
Ben

Last edited by benji (2021-06-03 13:15:43)

Offline

 

#2 2021-06-03 15:28:20

erAck
Only trying to help
2015-09-06
1998

Re: [resolved] Auto Synchronize

Take a look at your Piwigo installation's tools/remote_sync.pl script. You could run that in a cron job but make sure it isn't fired in too narrow time slices. It should never run in multiple parallel invocations. Also, as is it needs a Piwigo admin's username and password parameters on the command line that are visible in the environment, so not suited for shared hosting of non-separated users. And of course it will be visible in the crontab entry.


Running Piwigo at https://erack.net/gallery/

Offline

 

#3 2021-06-04 01:55:46

benji
Member
2021-05-28
2

Re: [resolved] Auto Synchronize

erAck, you are a genius. Thanks for this, worked like a charm.
The server is locked down and not shared with anyone so should be fine with that.
I'm probably going to be running it at 10 minute intervals which will add approx 100 images per sync to the albums.
Seeing how fast it syncs, I think that should be plenty of time between sync operations.

Thanks so much for your help!
Ben

Offline

 

#4 2021-09-18 11:54:29

ibarot
Member
2021-09-18
5

Re: [resolved] Auto Synchronize

Hi All,
Stumbled across this thread while searching for automatic sync. While this looks like solving my issue, I am getting this error :

perl remote_sync.pl --base_url=http://localhost/piwigo/dev/branches/2.0 --username=i*** --password=******

Can't locate LWP/UserAgent.pm in @INC (you may need to install the LWP::UserAgent module) (@INC contains: /usr/local/lib/perl5/site_perl /usr/local/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl) at remote_sync.pl line 8.
BEGIN failed--compilation aborted at remote_sync.pl line 8.

I am running this as a docker container on RaspberryPi4 with ghcr.io/linuxserver/piwigo image for piwigo and mariadb:10.5 image for DB. Am not sure how else to proceed to install these packages as apt commands fail in my container.

While I can manually add and sync pictures, I am looking at a scenario where upon upload, the sync would start automatically or at an predefined intervals say maybe 5 times a day.



Pls help.
Thanks,

Offline

 

#5 2021-09-18 15:09:30

erAck
Only trying to help
2015-09-06
1998

Re: [resolved] Auto Synchronize

apt-get install libwww-perl  would be easiest indeed.. Anyhow, if you can't do that then try to install as user-local Perl CPAN module.

Code:

perl -MCPAN -e ‘install Bundle::LWP’

See also search on perl install LWP::UserAgent.


Running Piwigo at https://erack.net/gallery/

Offline

 

#6 2021-09-19 09:55:41

ibarot
Member
2021-09-18
5

Re: [resolved] Auto Synchronize

Hi erAck,
Thanks for replying. I followed your command, but it gave lot of errors. I dont know Perl so am not sure what else to do here. The logs are filled with messages like these :

Running install for module 'HTTP::Status'
  OALDERS/HTTP-Message-6.33.tar.gz
  Has already been unwrapped into directory /root/.cpan/build/HTTP-Message-6.33-0
  OALDERS/HTTP-Message-6.33.tar.gz
  Has already been prepared
  OALDERS/HTTP-Message-6.33.tar.gz
  Could not make: Unknown error

Running install for module 'LWP::MediaTypes'
  OALDERS/LWP-MediaTypes-6.04.tar.gz
  Has already been unwrapped into directory /root/.cpan/build/LWP-MediaTypes-6.04-0
  OALDERS/LWP-MediaTypes-6.04.tar.gz
  Has already been prepared
  OALDERS/LWP-MediaTypes-6.04.tar.gz
  Could not make: Unknown error

Running install for module 'Test::Needs'
  HAARG/Test-Needs-0.002009.tar.gz
  Has already been unwrapped into directory /root/.cpan/build/Test-Needs-0.002009-0
  HAARG/Test-Needs-0.002009.tar.gz
  Has already been prepared
  HAARG/Test-Needs-0.002009.tar.gz
  Could not make: Unknown error

The container image does not have make command.

I searched on how to install LWP::UserAgent but all methods require either apt, or compile using make, none of which is available in the linuxserver:piwigo container.

Offline

 

#7 2021-09-19 10:58:45

erAck
Only trying to help
2015-09-06
1998

Re: [resolved] Auto Synchronize

Whatever, but DO NOT DO THAT AS root! Geez..


Running Piwigo at https://erack.net/gallery/

Offline

 

#8 2021-09-19 16:03:53

ibarot
Member
2021-09-18
5

Re: [resolved] Auto Synchronize

Hi,
Thanks for pointing it out.
As I am running this in container console, I don't know if there is any other option. I log into console via portainer and since the image is configured with root, I ran it with the same.

Offline

 

#9 2021-09-20 12:01:30

ibarot
Member
2021-09-18
5

Re: [resolved] Auto Synchronize

Hi,

I now ran the perl script from my host instead from inside the container. I believe this should have been the right way from the beginning. Anyways, I installed the required perl packages and it worked.

Thanks.

Offline

 

#10 2022-02-20 07:46:16

jimidmb
Member
2022-02-20
3

Re: [resolved] Auto Synchronize

Hello!

I'm tinkering with PiWiGo installed on a RaspberryPi4 and up to now, I'm really pleased with the platform.

However, I can't get auto sync to work. I'm running Piwigo with a NGINX server.

The perl script yields the same long "moved permanently" message posted above. I've searched for ways to enable mod_rewrite in NGINX but haven't been able to figure it out.

I also tried this method: https://github.com/pommes-frites/piwigo … ronisation

... but was unable to get it to work.

Any help would be greatly appreciated.


Thanks
Best regards,
Andrew

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact