Google Cloud Print (GCP) was a service that allowed you to print to a remote printer from anywhere. For business use it was very handy. I used it a LOT. But, in the BIG G's infinite wisdom, they canned it as of 2021 (I guess they couldn't glean as much data from print jobs as they thought they could!).
A year ago I made some attempts to make a replacement for GCP , but I've done more now. This was last year's efforts:
http://www.murga-linux.com/puppy/viewto ... =110831531
I've taken a few of the skills I've learned in the past 12 months and improved on it. To make this work, you need to have a printer installed at the receiving end and google drive (or other cloud server) working as a "local" filesystem. To do that, I used the technique here:
to create a "local" cloud drive. The one above is using Google Drive with rclone, but rclone can use a bunch of cloud services so take your pick. One big advantage of google drive is you can use this method to print from your phone (if that takes your fancy).
On the cloud drive (google drive) I've created two directories, "Print" & "Printed" & and a directory at /root "print_temp". Then I've created this basic script to print all pdf files from the "Print" directory to my Brother printer
Code: Select all
#!/bin/sh
cp ~/cloud/gdrive/Print/*.pdf ~/print_temp
lpr -o fit-to-page -o media=A4 -P Brother ~/cloud/print_temp/*.pdf
mv ~/cloud/print_temp/*.pdf ~/cloud/gdrive/Printed
rm ~/cloud/gdrive/Print/*.pdf
This copies all the pdf files from the remote drive (gdrive) to the local "print_temp" directory, then sends the pdf files directly to my "Brother" printer (you can change this to whatever the name of your printer is), then copies all the pdf files to the "Printed" directory on the remote drive (this step isn't necessary, but I like to keep a backup of my files to go over later, probably like google did with GCP!), then the last line deletes the files from the "Print" folder.
To make it all work just right, I made a cron job that runs the above script every 2 minutes. If there's a PDF in the "Print" folder, it'll print it, if there's nothing there, it just fails and ends.
This is working nicely for me. I have it all set up in Fatdog, but it will work in any Pup (or linux) with all the pre-requisites.