- 论坛徽章:
- 11
|
将你的这个脚本保存为shell
eg: crontabl.sh
#!/bin/sh
dbaccess omc_db<<!
unload to "/home/omcadmin/yerui/ttt/pm.txt"
select *
where (*)
and (*)
and (*)
and (*)
(bss_datetimes.date_and_time>=to_char(current year to day - interval(1) day to day,"%Y-%m-%d")||" 09:00")
and (bss_datetimes.date_and_time<=to_char(current year to day - interval(1) day to day,"%Y-%m-%d")||" 10:00")
order by *,* ;
!
然后root用户,在crontab中增加一行.
# crontab -e
* 4 * * * su - informix -c "<完整目录>/crontab.sh &" >/dev/null 2>&1
[ 本帖最后由 liaosnet 于 2007-10-30 09:15 编辑 ] |
|