How to use the Junit in JDeveloper
2009-08-31 16:05
549 查看
1)环境变量
自己写了一个py脚本用来备份mysql日志。手动可以正常执行,后来放到crontab中无法执行,无反应,也就是/var/logs/cron中有执行的记录,但没反应,该创建的日志也没创建。也就是没执行。网上查了半天也没点收获。后来自己改了一下终于可以成功运行。
机器上使用的是python2.4。
之前
* */2 * * * python /root/logbackup.py >> /root/logbackup.log
无法运行。后来给python添加了全路径,可以正常运行了。
* */2 * * * /usr/bin/python2.4 /root/logbackup.py >> /root/logbackup.log
2)if __name__ =='__main__':下被调用方法
另一种为脚本中写的类,运行时是从if __name__ == "__main__"开始执行,则上面类中定义的方法或脚本中未定义类,只定义了函数,放到if __name__ == '__main__'下,脚本在crontab中执行时,if __name__ =='__main__'下被调用的(类中)方法或(非类中)函数 不会被执行。
自己写了一个py脚本用来备份mysql日志。手动可以正常执行,后来放到crontab中无法执行,无反应,也就是/var/logs/cron中有执行的记录,但没反应,该创建的日志也没创建。也就是没执行。网上查了半天也没点收获。后来自己改了一下终于可以成功运行。
机器上使用的是python2.4。
之前
* */2 * * * python /root/logbackup.py >> /root/logbackup.log
无法运行。后来给python添加了全路径,可以正常运行了。
* */2 * * * /usr/bin/python2.4 /root/logbackup.py >> /root/logbackup.log
2)if __name__ =='__main__':下被调用方法
另一种为脚本中写的类,运行时是从if __name__ == "__main__"开始执行,则上面类中定义的方法或脚本中未定义类,只定义了函数,放到if __name__ == '__main__'下,脚本在crontab中执行时,if __name__ =='__main__'下被调用的(类中)方法或(非类中)函数 不会被执行。
相关文章推荐
- how to use a SQLite database in a standalone program with an HTML interface and VBScript as the programming language
- How to let "test2.c" use the variable in "test1.c"
- HOW TO: Change the Owner of a User-Defined Data Type That Is in Use in SQL Server 2000
- How to Access and Use the Windows Hosts File in Windows 7 and Vista
- use noscript html tag when user disable the javascript in browser, guide user how to enable the js in different browser and retu
- Notes on how to use Webots, especially how to make a robot fly in the air
- How-to: Use the ShareLib in Apache Oozie
- How To Use The New Multivalue Field In Access 2007/2010 Sunday, June 19th, 2011
- How to Use the TimeDistributed Layer for Long Short-Term Memory Networks in Python 译文
- How To Use the ODBC .NET Managed Provider in Visual C# .NET and Connection Strings
- How to Use the Mouse Wheel Event in HTML5 Pages
- How to use Events in the Context of C#
- How can I force Python's file.write() to use the same newline format in Windows as in Linux (“\r\n”
- How to find the correct version of JDeveloper to use with eBusiness Suite 11i or Release 12.x
- HOWTO Use Python in the web — Python v3.0.1 documentation
- "How to use QThread in the right way (Part 1)"
- QTP的那些事 -– Visual Relation Identifier Feature: How to use in the real world
- How and Why to use the System.servicemodel.MessageParameterAttribute in WCF
- How to use BTM as the transaction manager in Tomcat 6.x
- iOS 后台定位审核被拒How to clarify the purpose of its use in the location modal?