views:

20

answers:

0

Hi,

I have written a backend for creating ftp-users for proftpd via MySQL-module. After deleting a user from database some OS-specific tasks are left: deleting or moving the files of the user on file system level ("rm -R /home/dir/of/deleted/user").

The backend runs under linux user A, the ftp root belongs to user B. Therefore and for security reasons I can't directly modify the filesystem with user A via my ruby backend.

I'm thinking about a "wrapper" table in my MySQL-DB, for instance "tasks" with task.id, task.host, task.name, task.status etc..

Then I'm able to run a cronjob frequently under user ROOT and call another script, which "translates" the MySQL-Tasks into system commands.

Is this the right way? Are there some examples to study how to map abstract tasks to concrete system commands with ruby?

Thank you!