If you want to add dates to backups or logs, like mythtvDB27062008.sql within crontab, do the following:
0 0 * * * /usr/bin/mysqldump -u mythtv -pPassword mythconverg > /mythtv/recordings/mythtvDB`date +%d%m%Y`.sql
The key is the backquotes around the `date +%d%m%Y` command. This will backup a MythTV MySQL database to a file like this: /mythtv/recordings/mythtvDB27062008.sql every night at midnight.
This is a repository of all of my Linux/Unix writings as well as useful tips and tricks for systems administration, engineering, and programming.
Friday, June 27, 2008
Friday, June 13, 2008
Change hostname
To change the name of the computer's name (hostname) do the following:
#echo <hostname> > /etc/HOSTNAME
Example:
#echo earth > /etc/HOSTNAME
Subscribe to:
Posts (Atom)