Search code examples
sqlcroncron-taskcrontriggermysql-backup

setup cron that when a flash drive is mounted a file(sql) is written into it


I'm using cron to create my database backup file.

I'm wondering if I can setup it up in a way that when a flash drive(im thinking that the drive should have a specific name) is mounted the sql file will be written automatically into it.


Solution

  • Strictly speaking cron cannot be setup to do this. That is to say that cron is for strictly time based events.

    There are other ways to do this however. You can use udev for instance. For details on how to do this see: http://www.reactivated.net/writing_udev_rules.html.