Re: Sudo from scripts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 17, 2008 at 05:47:53AM +0000, g wrote:
> as a question of curiousness, and 'wat' from svr5 days, have you tried
> giving ownership of script to root?

I would suggest submitting it as a root cron job.  But go over the
script very, very carefully to make sure there are no security holes.

> also, if you want backup to run only after you are logged off, or after
> you have done something needing backup, have script check for 'filename'
> and then delete 'filename' as part of closing. this way, you can run
> 'touch filename' to enable.

One thing to remember about cleanup in scripts--use trap.  E.g.,

  TEMPFILE="/usr/tmp/foo.$$";
  ...
  trap "rm -f $TEMPFILE" 0;

It's useful for many other things, of course, but a very common use for
trap is to specify actions on exit.

Cheers,
--
	Dave Ihnat
	President, DMINET Consulting, Inc.
	dihnat@xxxxxxxxxx

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux