[X-Unix] virex cron
Stroller
MacMonster at myrealbox.com
Sun Mar 28 21:28:15 PST 2004
On Mar 28, 2004, at 4:29 pm, lists3-200402 wrote:
>>
>> I think this should do it:
>> /usr/local/vscanx/vscanx --move /SERVER/VOLUME/VIREX_OUT/QUARANTINE
>> /SERVER/VOLUME/SHARE --recursive --unzip --atime-preserve
>> --ignore-links --summary >> /SERVER/VOLUME/VIREX_OUT/SUMMARY.TXT &&
>> echo "Finished at:" >> /SERVER/VOLUME/VIREX_OUT/SUMMARY.TXT && date
>> >>
>> /SERVER/VOLUME/VIREX_OUT/SUMMARY.TXT
Actually, upon reflection, I see this is a little inelegant. I'd make
it shorter thus:
/usr/local/vscanx/vscanx --move /SERVER/VOLUME/VIREX_OUT/QUARANTINE
/SERVER/VOLUME/SHARE --recursive --unzip --atime-preserve
--ignore-links --summary >> /SERVER/VOLUME/VIREX_OUT/SUMMARY.TXT &&
echo "Finished at: `date`" >> /SERVER/VOLUME/VIREX_OUT/SUMMARY.TXT
> wow, dude, you rock!
Thank you, I'm flattered.
> the only problem i noticed is that now i get this error in the
> terminal when i run the cron script manually (cut/paste into root
> terminal):
>
> /SERVER/VOLUME/VIREX_OUT/QUARANTINE
> file could not be opened.
I'm not very good on permissions, but what do you mean by the "root
terminal"..? You are logged in as the root user, then..? If I change to
root user, my prompt changes thus:
silva:~ stroller $ sudo su -
Password:
silva:~ root#
The # is used as the prompt for root, the $ for ordinary users.
(Since the Americans call # the "pound sign" (which is what I call £),
and root is also known as the "super user", is this a reflection upon
the importance of my nation..?)
In you are logged in as root, I suspect cron is getting the same
message, you're just not seeing it (it may be in the logfiles
somewhere).
If you're trying this as normal user, try copying & pasting to the
terminal:
sudo /usr/local/vscanx/vscanx --move
/SERVER/VOLUME/VIREX_OUT/QUARANTINE /SERVER/VOLUME/SHARE --recursive
--unzip --atime-preserve --ignore-links --summary >>
/SERVER/VOLUME/VIREX_OUT/SUMMARY.TXT &&
sudo echo "Finished at:" >> /SERVER/VOLUME/VIREX_OUT/SUMMARY.TXT &&
sudo date >> /SERVER/VOLUME/VIREX_OUT/SUMMARY.TXT
`sudo` means "do as superuser", and must be applied to each command in
turn. Running the original line with only one sudo at the start only
applies it to the first command, not to the 2nd or third. I don't
recommend using `sudo` in your cron job - I'm guessing that's running
with root privs anyway, and I don't know what the effect would be.
Stroller.
More information about the X-Unix
mailing list