четверг, 15 апреля 2010 г.

Crontab problem

I have a problem with working crontab.

With this, cron didnt work.

root@# crontab -l

mysqldump -u user --password='password' -R --lock-tables  db |  gzip -c > "/home/bak/db_$(date +%F).sql.gz"

'man crontab'

The sixth field of a line in a crontab file is a string that

is  executed  by the shell at the specified times. A percent

character in this field (unless escaped by \) is  translated

to a NEWLINE character.

Now, i escaped percent character:

root@# crontab -l

mysqldump -u user --password='password' -R --lock-tables db | gzip -c > "/home/bak/db_$(date +\%F).sql.gz"

Its work.

Комментариев нет: