Linux KIOKS mode Chrome


Install following software

sudo apt-get install -y x11-xserver-utils unclutter

Create a new file

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart

Copy this code into the file

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
#@xscreensaver -no-splash
@xset s off
@xset -dpms
@xset s noblank
@sed -i 's/"exited_cleanly": false/"exited_cleanly": true/' ~/.config/chromium/Default/Preferences
@chromium-browser --incognito --noerrdialogs --kiosk
@unclutter -idle 0.1 -root
Backup files linux

Backup files linux

An easy way to backup files to a local share

The example backup’s the files from the /var/www/html directory

#change to website folders
cd /var/www/html/

#find all subsites
for D in *; do
    if [ -d "${D}" ]; then
        echo "Generating backup for $D > " `date +%Y-%m-%d_%H-%M-%S`-${D}   # your processing here
        tar -zcvf "/mnt/srv-ttp-nas/server/"`date +%Y-%m-%d_%H-%M-%S`-${D}.tar.gz ${D}

#remove stale files
find /mnt/srv-ttp-nas/server/* -mtime +14 -exec rm {} \;

Add crontab to run backup every night at 3

sudo crontab -e
0 3 * * * /home/tom/

Preview of data on share

Backup all mysql databases

Backup all mysql databases

I created an easy way to backup all mysql databases
/mnt/srv-ttp-nas/ is a location on a local NAS

sleep 10

BACKUP_DIR = "/mnt/srv-ttp-nas/bu/databases"

#find all databasses and backup them
databases=`mysql --user=$DB_USER --password=$DB_PASS -e "SHOW DATABASES;" | tr -d "| " | grep -v Database`

for db in $databases; do
        echo "Dumping database: $db"
        mysqldump $db -u $DB_USER -p --password=$DB_PASS | gzip > "/mnt/srv-ttp-nas/databases/"`date +%Y-%m-%d_%H-%M-%S`-$db.sql.gz

#remove files older than one month
find /mnt/srv-ttp-nas/databases/* -mtime +31 -exec rm {} \;

The power of this script is that if you add a new database this will automaticly be added.

Add to crontab to backup every 6 hours.

sudo crontab -e
0 0,6,12,18 * * * /home/tom/

Preview of data on share