So, I run an overnight python script that runs a backup of our web data in the /var/www directory, then moves the backups to an external HDD in /media.
Hello everyone,How do I schedule a custom .sh script that requires sudo?The situation I want is: The script runs according to schedule and appears in a terminal. I have to type in a password before this script can run. Then the script runs.Note:- The program I have for scheduling is cronie (default cron.)Here is the situation:I type: crontab -eIn the text editor, I add in: 0 17 * * * s
I visudoed sudoers to allow a user to run one bash script with a passwordless sudo, which works fine when logged in (also via SSH). However, when I log in via SSH using public key authentication and configure authorized_keys' command="sudo myScript", I am promped for the user password by sudo. Having the script itself use sudo on another program does however work without requiring a password.
I've made a script that preforms various system tasks, that I run regularly, but I have to use sudo to run the script, despite the fact that I own it because it runs root privileged commands. How can I add make sudo let me run this one file without having to enter my password every time I run it?
Hello all,
I have a script (script.sh) that is owned and executed by root.
Hi,
Im trying to run script A which requires path /sbin.
I have a crontab entry to run script A every 10 minutes.
Script A is executed fine by cron, but because script A requires /sbin in its path it fails to run.
My situation is script A get overwritten from time to time so I can't modify script A to set path in there.
So my question is...
#!/bin/bash
value=$(</var/www/sym_monitor/manthan.txt)
if [ "$value" == "true" ]; then
ps -ef|grep sym |grep -v grep |awk '{ print $2 }'|sudo xargs kill -9;
cd /var/www/symmetric-ds-3.1.6/bin;
sleep 30;
(sudo ./sym --port 8082 --server);
fi
I'm trying to run the above script every 10 mins using cron.
I need execute script that have commands which should be run in root mode.
If I put sudo before command then when I run script I see permission denied ( I don't have a chance to write password).
If I run script with sudo then it writes - command not found.
If I put sudo su in the beginning of the script then after I inter password nothing happens.
When I create new Ubuntu 12.10 instances, I typically bootstrap them by manually SSHing onto the machine and editing the sudoers to put a NOPASSWD on the default user (e.g., ec2-user, azureuser, etc.). Then my install scripts can sudo various commands without having to provide a password.
I don't have anything against passwords.