Friday, August 25, 2006
How to allow Normal Linux User to run particulare bash / shell script
Plz, help me out i want to allow one of my linux user to run this below bash script to take mysql database backup.
[b]Shell Script:[/b]
#!/bin/bash
TIMESTAMP=`date +%m-%d-%y-%H%M`
cd /home/backups/mysql
find /home/backups/mysql/*.tar.gz -mtime +7 -exec rm -f {} ;
# my database
DBNAME=my_database
mysqldump --opt -c -e -Q -u MYSQL_USER -p'MYSQL_PASSWORD' $DBNAME > $DBNAME.sql
tar czpf $DBNAME.$TIMESTAMP.tar.gz $DBNAME.sql
rm -f $DBNAME.sql
But when i am running this script as a normal user it is giveing me an error of "Permission denied"
Thanks
Harshad Pandit
alias(PHP Pandit)
Harshad Pandit's Blog
Thursday, June 01, 2006
Features Mysql 5.0
Cursors: Elementary support for server-side cursors. For information about using cursors within stored routines, see Section 17.2.9, "Cursors". For information about using cursors from within the C API, see Section 22.2.7.3, "mysql_stmt_attr_set()".
Information Schema: The introduction of the INFORMATION_SCHEMA database in MySQL 5.0 provided a standards-compliant means for accessing the MySQL Server's metadata; that is, data about the databases (schemas) on the server and the objects which they contain. See Chapter 20, The INFORMATION_SCHEMA Database.
Instance Manager: Can be used to start and stop the MySQL Server, even from a remote host. See Section 5.5, "mysqlmanager — The MySQL Instance Manager".
Precision Math: MySQL 5.0 introduced stricter criteria for acceptance or rejection of data, and implemented a new library for fixed-point arithmetic. These contributed to a much higher degree of accuracy for mathematical operations and greater control over invalid values. See Chapter 21, Precision Math.
Storage Engines: Storage engines added in MySQL 5.0 include ARCHIVE and FEDERATED. See Section 14.8, "The ARCHIVE Storage Engine", and Section 14.7, "The FEDERATED Storage Engine".
Stored Routines: Support for named stored procedures and stored functions was implemented in MySQL 5.0. See Chapter 17, Stored Procedures and Functions.
Strict Mode and Standard Error Handling: MySQL 5.0 added a strict mode where by it follows standard SQL in a number of ways in which it did not previously. Support for standard SQLSTATE error messages was also implemented. See Section 5.2.5, "The Server SQL Mode".
Triggers: MySQL 5.0 added limited support for triggers. See Chapter 18, Triggers, and Section 1.9.5.4, "Stored Routines and Triggers".
VARCHAR Data Type: The maximum effective length of a VARCHAR column was increased to 65,532 bytes, and stripping of trailing whitespace was eliminated. See Section 11.4, "String Types".
Views: MySQL 5.0 added support for named, updatable views. See Chapter 19, Views, and Section 1.9.5.6, "Views".
XA Transactions: See Section 13.4.7, "XA Transactions".