I have to setup cron job every last month, so I should create simple script to determine if today is the last day in the month. I modified a lil bit from here : ?Download lastmonth.sh1 2 3 4 5 6 7 8 9 10 11 12 13 #!/bin/bash MYTZ=`date | awk '{print $5}'` TOM=$(TZ=$MYTZ-24 date +%d) #echo $TOM if [ $TOM == 01 ] then echo "Last [...]
The problem occured when I had to send an email to myself for reporting purposes from server. It said like these : Insufficient disk space; try again later returntosender: cannot select queue for root Insufficient disk space; try again later returntosender: cannot select queue for postmaster putbody: write error: No space left on device Error writing control file qfoBV4nP7w025109: No space left on device Then I found that my /var [...]
I’m just wanna create a note, because sometime this simple thing is forgotten. To exclude a file or folder from archiving process, we can use –exclude option behind tar command. Example : tar -czvf file-result.tar.gz /path/to/file/or/folder/for/archiving –exclude “/path/to/exclude”
For urgent reason like preventing website down when dumping MySQL, we need to skip lock-tables. You can use -–skip-lock-tables and –skip-add-locks option with mysqldump command. Example : mysqldump -u 412843_reebonzsg -p –skip-add-locks –skip-lock-tables db_name \ > dbfile_dump.sql