workshops:byo_scripts
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
workshops:byo_scripts [2010/08/01 13:56] – rmoonen | workshops:byo_scripts [2010/08/21 14:41] – rmoonen | ||
---|---|---|---|
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 46: | Line 51: | ||
Oh, and here is a nice little five liner to do off-site backups of parts of your system, run | Oh, and here is a nice little five liner to do off-site backups of parts of your system, run | ||
- | it as a cronjob in / | + | it as a cronjob in / |
< | < | ||
#! /bin/bash | #! /bin/bash | ||
enum=`date +%F` | enum=`date +%F` | ||
- | tar -czf /tmp/eros-backup$enum.tgz /home/mint / | + | tar -czf / |
- | scp -B /tmp/eros-backup$enum.tgz robert@ares:/ | + | scp -B / |
- | rm -rf /tmp/eros-backup$enum.tgz | + | rm -rf / |
+ | exit 0 | ||
+ | </ | ||
+ | |||
+ | And here is the script to delete old backups: | ||
+ | |||
+ | < | ||
+ | # | ||
+ | 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.txt · Last modified: 2017/10/12 21:58 by 127.0.0.1