php-pandit Posted August 26, 2006 Share Posted August 26, 2006 Hi 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/bashTIMESTAMP=`date +%m-%d-%y-%H%M`cd /home/backups/mysqlfind /home/backups/mysql/*.tar.gz -mtime +7 -exec rm -f {} ;# my databaseDBNAME=my_databasemysqldump --opt -c -e -Q -u MYSQL_USER -p'MYSQL_PASSWORD' $DBNAME > $DBNAME.sqltar czpf $DBNAME.$TIMESTAMP.tar.gz $DBNAME.sqlrm -f $DBNAME.sql<!---------------- ##################### ----------------------->But when i am running this script as a normal user it is giveing me an error of [b]"Permission denied"[/b]ThanksHarshad Panditalias(PHP Pandit)<a href="http://php-pandit.blogspot.com/">Harshad Pandit's Blog</a> Link to comment https://forums.phpfreaks.com/topic/18695-how-to-allow-normal-linux-user-to-run-particulare-bash-shell-script/ Share on other sites More sharing options...
steelmanronald06 Posted August 28, 2006 Share Posted August 28, 2006 Gotta make that user part of the mysql group ;) Link to comment https://forums.phpfreaks.com/topic/18695-how-to-allow-normal-linux-user-to-run-particulare-bash-shell-script/#findComment-81572 Share on other sites More sharing options...
Daniel0 Posted August 28, 2006 Share Posted August 28, 2006 You just need to give it executable permissions (or whatever you'd call it).[code]chmod +x your_script.sh[/code] Link to comment https://forums.phpfreaks.com/topic/18695-how-to-allow-normal-linux-user-to-run-particulare-bash-shell-script/#findComment-81727 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.