Spotlight | Reviews | Current Issue | Academy | Newsletter | Subscribe | Shop |
Departments

Partner Links
Make your own website
WinWeb OnlineOffice
Comparing prices of hardware is worth it.
Price Comparison
What:
Where:
Country:
vacatures Netherlands njobs Linux vacatures
arbeit Deutschland njobs Linux arbeit
work United Kingdom njobs Linux jobs
Lavoro Italia njobs Linux lavoro
Emploi France njobs Linux emploi
trabajo Espana njobs Linux trabajo

user friendly

Admin Magazine

ADMIN Network & Security

Subscribe now and save!

 ADMIN - Explore the new world of system administration! ADMIN is a smart, technical magazine for IT pros on heterogeneous networks. Each issue delivers technical solutions to the real-world problems you face every day. Learn the latest techniques for better:

  • network security
  • system management
  • troubleshooting
  • performance tuning
  • virtualization
  • cloud computing

 on Windows, Linux, Solaris, and popular varieties of Unix.

http://www.admin-magazine.com/

  linux-magazine.com » Online » Blogs » Productivity Sauce » Use GoogleCL to Upload Photos to Picasa Web Album  

Productivity Sauce
Productivity Sauce

Use GoogleCL to Upload Photos to Picasa Web Album

If you are using Google's Picasa Web Album photo sharing service and you want to automate the process of uploading photos, the GoogleCL command-line toolset can come in rather handy. Once installed on your machine, you can use it to perform several tasks such as creating albums, uploading and tagging photos, downloading photos, etc. directly from the command-line. Better yet, GoogleCL is pretty straightforward in use. For example, you can upload all photos in a directory to a specific album using the following command:

google picasa post --title "Travel Photos" /home/user/photos/*.jpg

If the specified album doesn't exist, GoogleCL automatically creates it for you. When you run GoogleCL for the run, you have to authorize it for use with the Picasa Web Album service.

To automate the uploading process you can write a simple Bash script and create a cron job to run it on a regular basis. The script below uploads all photos in the /home/user/photos directory to the Travel Photos album and then empties the directory:

#!bin/bash
google picasa post --title "Travel Photos" /home/user/photos/*
echo "Photos have been uploaded."
rm /home/user/photos/*.jpg

If you want to tag the photos during upload, then the command should look something like this:

google picasa post --title "Travel Photos" --tags berlin /home/user/photos/*

To run the script on a regular basis, you need to set up a cron job. Run the crontab -e command, specify the following cron job (replace the sample path with the actual path to the upload script) and save the modified crontab file:

@hourly /home/user/picasaupload.sh >> /home/user/picasaupload.log

This cron job will run the script every hour and log the result in the picasaupload.log file.

Comments

Synchronizing rather than uploading

VDM Feb 14, 2012 11:09pm GMT

I think what most people want is actually to synchronize (without deletion) a local folder with picasa, and that's something you can not do with googlecl....
I wrote a small jar to solve this problem. It is available here: http://vincesoft.blogspot.c...automatically-synchronize.html

No error checking

hobbyte May 13, 2011 9:57am GMT

and all files will be lost if the server did not accept them
for example, when an error:
"Loading file /home/user/photos/1.jpg to album Travel Photos
Failed to upload /home/user/photos/1.jpg. (400: Bad Request)
1 photos failed to upload"

Print this page. Recommend
Share