Archive for the ‘Linux’ Category

automatic mysql db backup

# cd /etc/cron.daily/ # touch /etc/cron.daily/ # chmod 755 /etc/cron.daily/ # vi /etc/cron.daily/ Then copy following lines into file with Shift+Ins #!/bin/sh now=”$(date +’%d_%m_%Y_%H_%M_%S’)” filename=”db_backup_$now”.gz backupfolder=”/var/www/vhosts/” fullpathbackupfile=”$backupfolder/$filename” logfile=”$backupfolder/”backup_log_”$(date +’%Y_%m’)”.txt echo “mysqldump started at $(date +’%d-%m-%Y %H:%M:%S’)” >> “$logfile” mysqldump –user=mydbuser –password=mypass –default-character-set=utf8 mydatabase | gzip > “$fullpathbackupfile” echo “mysqldump finished at $(date +’%d-%m-%Y %H:%M:%S’)” >> […]

Installing php, mysql, phpMyAdmin on LinuxMint

sudo apt-get install apache2 sudo apt-get install php5 libapache2-mod-php5 sudo apt-get install mysql-server apt-cache search pdo|grep php /*find how pdo package is callled) sudo apt-get install php-db php5-mysql