workshops:byo_scripts
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| workshops:byo_scripts [2010/08/01 04:09] – rmoonen | workshops:byo_scripts [2017/10/12 10:58] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 28: | Line 28: | ||
| {{: | {{: | ||
| - | First master a CD with your images, using the directory structure you want to use on the webpage, mine starts with / | + | First master a CD with your images, using the directory structure you want to use on the webpage, mine starts with / |
| You will have to change the relative path in photo2html_table.sh to reflect this. | You will have to change the relative path in photo2html_table.sh to reflect this. | ||
| Line 34: | Line 34: | ||
| Make your working directory path the same as the relative path on your CD except | Make your working directory path the same as the relative path on your CD except | ||
| on your www/ | on your www/ | ||
| + | My CD directory structure is ${Camera_name}/ | ||
| + | The document root is / | ||
| To prepare your images we use part of the imagemagick suite with this command: | To prepare your images we use part of the imagemagick suite with this command: | ||
| $ mogrify -size 120x120 *.jpg -resize 120x120 +profile " | $ mogrify -size 120x120 *.jpg -resize 120x120 +profile " | ||
| - | Now run the photo2html script. | + | Now run the photo2html script |
| + | ../ | ||
| + | |||
| + | Document root of your photo album is Document root/photos | ||
| The path for $base in photo2html.sh will have to be changed according to the distribution used. | The path for $base in photo2html.sh will have to be changed according to the distribution used. | ||
| Line 54: | Line 59: | ||
| scp -B / | scp -B / | ||
| rm -rf / | rm -rf / | ||
| + | exit 0 | ||
| + | </ | ||
| + | |||
| + | And here is the script to delete old backups: | ||
| + | |||
| + | < | ||
| + | #!/bin/bash | ||
| + | COUNT=0 | ||
| + | for file in `ls -c / | ||
| + | do | ||
| + | COUNT=`expr $COUNT + 1` | ||
| + | # If we have 8 backups, delete the last, so we only keep a weeks worth, deleting the oldest | ||
| + | if [ 0$COUNT -eq 8 ] | ||
| + | then | ||
| + | rm / | ||
| + | COUNT=`expr $COUNT - 1` | ||
| + | fi | ||
| + | done | ||
| + | exit 0 | ||
| </ | </ | ||
| + | Run this script on your webserver. | ||
| + | Of course I could have just used find with the -exec option utilising rm, but I wanted to use bash. ;-) | ||
workshops/byo_scripts.1280635742.txt.gz · Last modified: 2017/10/12 10:58 (external edit)