Hi all
I have been working on a script to run apt-get (download only) daily
I am getting the following error when I test run it with the verbose option:
"[EMAIL PROTECTED] /etc/cron.daily/daily_apt-get -v
/etc/cron.daily/daily_apt-get: line 11: upgrade: command not found
apt 0.5.28.4 for linux i386 compiled on Feb 11 2005 08:15:54
Usage: apt-get [options] command
apt-get [options] install|remove pkg1 [pkg2 ...]
apt-get [options] source pkg1 [pkg2 ...] ..."
so what I'm not sure is how to run the "MYSCRIPT=/usr/bin/apt-get" command
with the "-d" "upgrade" & "y" options on, the script runs with these options
removed (but of course doesn't apt-get, without intervention)
Any suggestions on how to fix or improve this script would be appreciated
Myscript (start):
#!/bin/sh
# This file is daves /etc/cron.daily/daily_apt-get
# This "daily_apt-get" program runs daily to download updates from
# mirrors sites using "apt-get". Updates are downloaded (only),
# using the "-d" option & and are installed later manually
# Output is logged to the system administrator via "sendmail"
# Uncomment the following line to disable
#exit 0
MYSCRIPT= /usr/bin/apt-get -d upgrade -y
[ -x /usr/sbin/sendmail ] || exit 0
if [ ! -x "$MYSCRIPT" ]; then
echo "Can't find $MYSCRIPT"
exit 1
fi
$MYSCRIPT
(script end)
--
cheers................dave
Mail to: "[EMAIL PROTECTED]"
____________________________________________
KMail 1.7.2 & Kontact - KDE Desktop 3.3.2
SimplyMEPIS Linux - Kernel 2.6.7 (i686)
____________________________________________