Julien Vehent on 31 Aug 2011 08:33:39 -0700 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
[PLUG] Bash I/O redirection |
Hey Guys,I have this bash script that does an oracle backup (launched via crontab), and I'd like to redirect the output of the script to a file. The classic ways to do it would be:
* use a wrapper script (that requires an additional script...) * call the script with '>' in the cron line (make my cron line ugly) * inside the script, put a ">>" after each command (berk !)My question is: would there be a way to put a global redirection at the beginning of the script ?
something like "1 > /tmp/log.txt" and then have all the subsequent commands go to the log file ? Thanks, Julien ___________________________________________________________________________ Philadelphia Linux Users Group -- http://www.phillylinux.org Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug