The Gallery Continued

It's taken over a day to rationalise the scripts that keep the gallery updating.

The single biggest let down during the process is the Windows 10 scheduling. The scripts themselves worked perfectly.  When the scheduler touched them, things got weird - even with various variables set to define different locations to store temporary text files that would provide file lists and the like, those files shared the same names. That was resulting in the first script running dumping the files it found in the locations where all 3 were copying too. 

Changing the variables fixed that. Except that the paths were a challenge. The user account some of the files are stored in locally is a domain account. For whatever reason, Windows 10 didn't want the domain user to be able to run the scheduled tasks. So, I added that user to the local admins group. Even that took effort as the usual method did not work. 

One of the locations was a mapped drive.  That wound up being a problem. The only two accounts on the PC that map it are the normal domain user account, and the administrator. The local administrators group however doesn't have mapping for it so it can't get to it. It was in the end easier to move that file location to the local disk.

A few other tweaks later given the general stupidity and bloat of "Scheduled Tasks" within Windows, I got there.

Getting Piwigo to synchronise was another pain; the only method to make this occur is to have an authenticated HTTP session into the site, pass credentials and let it go. Why on earth the application doesn't contain code to do this automatically is beyond me. People have been asking for it for the past decade.

Getting around this was tedious but achievable. I stole a perl script that was able to do the job, but ran into issues on the server with Perl. It had 2 versions installed, and the current version hadn't linked to the perl binary. I was also missing some of the extra components. The server runs FreeBSD, so it took a little bit of fiddling, but I was eventually able to work out the problem and get the script running. This webserver isn't one I've had to run perl on before hence the state it was in. 

At least being a Unix system, scheduling of this script is far more rational. A simple cron job and off it goes. 

There are some learnings to be had from this:

- I don't administer Windows systems as well as I do Unix for a reason.

- I hate any kind of coding in Windows. I don't really like any kind of coding. I suck at it. I just hate doing it in Windows more.

- Piwigo is fairly limiting in its functionality, but it works. Being able to script myself to a point where this is automated to being within an hour of receiving images is pretty good. The time itself is arbitrary - I could just as easily set this to run once a day... or once every 5 minutes. My network won't even notice this happening.

To dos:

Find a way to silence the batch files that do the FTP work. They're currently scheduled 5 minutes apart and run every hour, so at the moment they're popping up on the screen when running.

Comments

Popular Posts