Chetsheet delle combinazioni di tasti utilizzabili all'avvio per condizionare il comportamento dell'UEFI.
Keystroke | Description |
---|---|
Press C during startup | Start up from a bootable CD, DVD, or USB thumb drive (such as OS X install media). |
Press D during startup | Start up in Apple Hardware Test (AHT). |
Press Option-Command-P-R until you hear startup sound a second time. | Reset NVRAM |
Press Option during startup | Start up in Startup Manager, where you can select an OS X volume or network volume to start from. |
Press Eject, F12, or hold the mouse or trackpad button | Ejects any removable media, such as an optical disc. |
Press N during startup | Attempt to start up from a compatible network server (NetBoot). |
Press T during startup | Start up in Target Disk Mode. |
Press Shift during startup | Start up in Safe Boot mode and temporarily disable login items. |
Press Command-V during startup | Start up in Verbose mode. |
Press Command-S during startup | Start up in Single-User mode. |
Press Option-N during startup | Start from a NetBoot server using the default boot image. |
Press Command-R during startup | Start from the OS X Recovery System |
E' raccomandato, anzi praticamente obbligatorio, configurare il backup automatico dei database MySQL (o MariaDB) del poprio server effettuando il dump completo di ogni database presente.
Prima di tutto, è necessario creare un utente che abbia i permessi di effettuare il backup e il ripristino dei dati, lo chiameremo backupuser.
I permessi minimi per poter effettuare il backup completo del server sono questi:
LOCK TABLES, SELECT, FILE, RELOAD, PROCESS, SUPER, SHOW VIEW
Mentre per il ripristino dei dati sono necessari questi permessi:
CREATE, DROP, INDEX, SHUTDOWN, INSERT, ALTER, SUPER, REPLICATION CLIENT, CREATE, VIEW
Per creare il nostro utente backupuser invieremo quindi la seguente query:
CREATE USER 'backupuser'@'localhost' IDENTIFIED BY 'PASSWORD'; GRANT SELECT , RELOAD , FILE , SUPER , PROCESS, LOCK TABLES , SHOW VIEW ON * . * TO 'backupuser'@'localhost' IDENTIFIED BY 'PASSWORD' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
Ora che abbiamo creato l'utente, non rimane che configurare un cronjob per effettuare automaticamente il backup, ad un orario in cui il nostro production server non sia carico di lavoro, per esempio mezzanotte.
Creiamo uno script mysql-backup.sh più o meno così (non fate copia e incolla, personalizzate il codice!):
#!/bin/sh DIR=/backuppath/ DATESTAMP=$(date +%Y%m%d%H%M) DB_USER=backupuser DB_PASS='PASSWORD' # remove backups older than $DAYS_KEEP DAYS_KEEP=7 find ${DIR}* -mtime +$DAYS_KEEP -exec rm -f {} \; 2> /dev/null # create file mask umask 006 # list MySQL databases and dump each to a different file DB_LIST=`mysql -h 127.0.0.1 -u$DB_USER -p"$DB_PASS" -e'show databases;'` DB_LIST=${DB_LIST##Database} for DB in $DB_LIST; do FILENAME=${DIR}${DB}-${DATESTAMP}.sql.gz mysqldump -h 127.0.0.1 -u$DB_USER -p"$DB_PASS" -x $DB | gzip > $FILENAME done
Per configurare il cronjob è sufficiente aggiungere una riga alla crontab:
crontab -e
e creare il cronjob:
0 0 * * * /path-to-script/mysql-backyp.sh
Ovviamente lo script è utilizzabile, come vedete dal sorgente e dalla documentazione di mysqldump, anche in remoto ed è possibile poi trasferire i backup tramite scp su ulteriori server esterni per finalità di backup.