Garfield (Linux): Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Zeile 76: | Zeile 76: | ||
day=`date +%d` | day=`date +%d` | ||
file_name=$year-$month-$day.gif | file_name=$year-$month-$day.gif | ||
folder=/home | folder=/mnt/synology/web1/home/garfield/downloads/$year/$month | ||
current_date=$day-$month-$year | current_date=$day-$month-$year | ||
if [ -e $folder/$file_name ] ; then | if [ -e $folder/$file_name ] ; then | ||
echo "Garfield strip from $current_date" | mutt -a $folder/$file_name -s "Garfield $current_date" -- martin. | echo "Garfield strip from $current_date" | mutt -a $folder/$file_name -s "Garfield $current_date" -- martin@kirner.or.at 2>&1 | ||
echo "Garfield $current_date successfully sent..." | echo "Garfield $current_date successfully sent..." | ||
fi | fi |
Version vom 20. August 2020, 19:27 Uhr
Skripte
sudo mkdir -p /mnt/synology/web1/home/garfield/bin/ sudo touch /mnt/synology/web1/home/garfield/bin/download_homepage.sh sudo touch /mnt/synology/web1/home/garfield/bin/download_backup.sh sudo touch /mnt/synology/web1/home/garfield/bin/send.sh sudo chmod a+x /mnt/synology/web1/home/garfield/bin/*.sh
download_homepage.sh
sudo vi /mnt/synology/web1/home/garfield/bin/download_homepage.sh
#!/bin/sh # # Starts download of Garfield strips for /mnt/synology/web1/www/garfield # current_dir=`pwd` base_dir_binary=/mnt/synology/web1/home/garfield base_dir_homepage=/mnt/synology/web1/www/garfield echo "Move to '$base_dir_homepage'..." cd $base_dir_homepage echo 'Downloading strips (Homepage)...' sudo -u www-data java -jar $base_dir_binary/bin/garfield-1.0.jar . echo "Move back to original folder ('$current_dir')..." cd $current_dir
download_backup.sh
sudo vi /mnt/synology/web1/home/garfield/bin/download_backup.sh
#!/bin/sh # # Starts download of Garfield strips for /mnt/synology/web1/home/garfield/downloads/ # current_dir=`pwd` base_dir_binary=/mnt/synology/web1/home/garfield base_dir_backup=/mnt/synology/web1/home/garfield/downloads echo "Move to '$base_dir_backup'..." cd $base_dir_backup echo 'Downloading strips (Backup)...' sudo -u martin java -jar $base_dir_binary/bin/garfield-1.0.jar . echo "Move back to original folder ('$current_dir')..." cd $current_dir
send.sh
sudo vi /mnt/synology/web1/home/garfield/bin/send.sh
#!/bin/sh # # Sending of Garfield strips per mail # year=`date +%Y` month=`date +%m` day=`date +%d` file_name=$year-$month-$day.gif folder=/mnt/synology/web1/home/garfield/downloads/$year/$month current_date=$day-$month-$year if [ -e $folder/$file_name ] ; then echo "Garfield strip from $current_date" | mutt -a $folder/$file_name -s "Garfield $current_date" -- martin@kirner.or.at 2>&1 echo "Garfield $current_date successfully sent..." fi
Webserver
Root-Verzeichnis
sudo mkdir /mnt/synology/web1/www/garfield sudo chown -R www-data:www-data /mnt/synology/web1/www/garfield
Zurück zu Ubuntu