Skip to content

Instantly share code, notes, and snippets.

@IlyaZha
Last active May 7, 2020 11:49
Show Gist options
  • Save IlyaZha/5d3aef4f609000a6a8db0ac79760bf8f to your computer and use it in GitHub Desktop.
Save IlyaZha/5d3aef4f609000a6a8db0ac79760bf8f to your computer and use it in GitHub Desktop.
crontab
Всякие полезные команды
0 4 * * * mysqldump -uroot -p database --ignore-table=database.core_url_rewrite | gzip > `date +database.%Y%m%d.%H%M%S.sql.gz`
0 4 * * * find /backups -type f -mtime +30 -print0 | xargs -0 rm -f
tar -pczvf archive.tar.gz --exclude={'*.avi','*.jpg','*.png','*.jpeg','*.gif'} /path/to/dir
sed -ie 's/ROW_FORMAT=FIXED//g' newdump.sql
select * from cron_schedule where created_at like '2017-05%' GROUP BY job_code
Найти базу и скопировать из огромного файла:
sed -n '/^-- Current Database: `itspurt_shopify_instockreminder`/,/^-- Current Database: `/p' 2016-03-01.sql > isr2016-03-01.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment