• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

Simple Shell Code, Trouble with SUDO

bealzz

Gawd
Joined
Jun 4, 2003
Messages
545
This might be the wrong place, but I thought I'd try here first.
I've got the following backup script on ubuntu;
Code:
#!/bin/sh

# remote login
LOGIN=*****

# backup server IP
BSERVER=10.210.10.109

# get today's day of the week (ie: Tuesday)
DATE=`date +%A`

# remote directory to backup to
BDIR=/OSSbackup/Cacti/$DATE

# 1st directory to backup
DIR=/etc
rsync -r -q $DIR -e ssh $LOGIN@$BSERVER:$BDIR

Well the script works great, but when I run it, it asks for the SUDO password.
I wanted to but this in the cron.daily file so that it would run everyday.
Is there a way to make this work, by that I mean run the command "sudo ./backup" without asking for the password?

Thanks
 
I don't think it's the sudo password - I think it's asking for login credentials to ssh into $BSERVER (since cron.daily should be running as root already). Look into using SSH keys (or some other mechanism to run/authenticate rsync)
 
Back
Top