Geen categorie

Backup Script


cd /home/backupjff

FTP_HOST=""
FTP_USERNAME=""
FTP_PASSWORD=""

MYSQL_HOST=""
MYSQL_USERNAME=""
MYSQL_PASSWORD=""

DATE=`date +%e-%m-%y`
DATA_BACK=`date +%e-%m-%y --date="2 days ago"`
echo $DATE
echo $DATA_BACK

mkdir mysql
mkdir site
mkdir svn
mkdir mail

DBS="$(mysql -u $MYSQL_USERNAME -h $MYSQL_HOST -p$MYSQL_PASSWORD -Bse 'show databases')"

for db in $DBS
do
mysqldump -u $MYSQL_USERNAME -h $MYSQL_HOST -p$MYSQL_PASSWORD $db > "/home/backupjff/mysql/$db.sql"
done

cp -r /hd2/www/wiki.justforfun-gaming.com site/
cp -r /hd2/www/uploads.justforfun-gaming.com site/
cp -r /hd2/www/thunderbug.justforfun-gaming.com site/
cp -r /hd2/www/forum.justforfun-gaming.com site/

svnadmin dump /var/svn/cvo_punten > svn/cvo_punten.dump
svnadmin dump /var/svn/controlpanel > svn/controlpanel.dump
svnadmin dump /var/svn/addon_server > svn/addon_server.dump
svnadmin dump /var/svn/addon_master > svn/addon_master.dump
svnadmin dump /var/svn/addon_client > svn/addon_client.dump

cp -r /var/vmail mail/

tar -cvf mysql.tar mysql/
tar -cvf site.tar site/
tar -cvf svn.tar svn/
tar -cvf mail.tar mail/

rm -r site
rm -r mysql
rm -r svn
rm -r mail
ncftp -u"$FTP_USERNAME" -p"$FTP_PASSWORD" $FTP_HOST<<EOF
mkdir $DATE
cd $DATE
mput mysql.tar
mput site.tar
mput svn.tar
mput mail.tar

cd ..
rm -r $DATA_BACK
quit
EOF
rm mysql.tar
rm site.tar
rm svn.tar
rm mail.tar

Mybb: Write theme to files

I like developing in files more then in the mysql database. Since the theme is cached in the database with mybb and there are not external files. I decided to a small hook for it. Though i’m not familiar with mybb and its plugin system.

Edit the class_templates.php file in the folder inc :

 

		if(is_dir("dev")){
			if(!is_dir("dev/".$theme['templateset'])){
				mkdir("dev/".$theme['templateset'], 0700);
			}

			if(!file_exists("dev/".$theme['templateset']."/".$title.".htm")){
				$fh = fopen("dev/".$theme['templateset']."/".$title.".htm", 'w');
				fwrite($fh, $this->cache[$title]);
				fclose($fh);
			}

			$fh = fopen("dev/".$theme['templateset']."/".$title.".htm", 'r');
			$this->cache[$title] = fread($fh, filesize("dev/".$theme['templateset']."/".$title.".htm"));
			fclose($fh);
		}

Add this around line 105 and crate a folder dev in the mybbroot. The rest will be autogenerated. Its purely for dev’s who wanne create a theme. I hope you have fun.

My old trainy :P

Though its a bit dusty, the train is here for repairment. It dropped of the table when i was younger and the back connection broke off. I’m thinking of putting this train with some passenger wagons in a backwards connection, for pulling them up the mountain to a little station. So i dont really need the connection at the back. Next step will be making it digital and giving it some smoke 🙂

More stuff about my trains coming soon. And hopefully some train configurations for my new railroads i’m gonna make. But first step is getting all my trains digital 1 by 1 and setup a small testing track.