I have a non-ui app to run on my vps. Every 1 hour it gets some info from web and send to my sql database. I am planning to run the app 1 time and make this process every 1 hour with a timer . ( so the app will run forever . Does it make any problem for my server ? For example logs will be very big after some time so maybe i must not log the information inside my app or any other problems like this ?
Make sure to run the app with nohup. There is no problem with running non-ui apps for very long times. The B4i builders which are implemented as B4J servers (non-ui apps) were running for 4 months before the last update (which required restarting them).
one of my app has a server running non-stop for almost a year now, and no issue so far
The problem you may have is with your logs as you mention. If you want to write them to a file, you first need to read the file, then append your line to the text and write the whole file again. That can slow down your app if you have thousands of lines in your log.
Make sure to run the app with nohup. There is no problem with running non-ui apps for very long times. The B4i builders which are implemented as B4J servers (non-ui apps) were running for 4 months before the last update (which required restarting them).
What is the difference with this and nohup ? It is working fine now but i can change it if it is not ok and start with nohup ( don't know what it is but i can find out =) )
Note that the issue with the logs growing indefinitely is not a real problem in most cases.
When you run the program with nohup the output is redirected to nohup.out which is deleted every time that you start the server.
Assuming that your program writes 10000 messages per day. This is about 200kb per day. So after one year of the server running non-stop the log file will be 70mb. This is the same size of a 20 seconds video file.
I did not use nohup but it is still running. I don't know why but thanks for information. I will start with nohup next time. Thanks Erel for your clarification. My app only writes about 1000 lines. So no problems there.