How To Pipe To A Ruby Command Line Application
You need to read from STDIN rather than parse command line arguments.
Backup and Rotate MySQL Databases Simple Bash Script
Make a directory ( it can anywhere ) called baks/mysql
mkdir -p /baks/mysql
Create a file (it can be anywhere) called /root/mysql_backups.sh and put this script in it
# modify the following to suit your environment