This is a creation in Article, where the information may have evolved or changed.
Nohup command
Deployed under Linux, we can use the Nohup command to deploy the application on the backend as follows:
Nohup./yourapp &
So your application is running on the Linux system daemon.
Nohup command: If you are running a process and you feel that the process will not end when you exit the account, you can use the Nohup command. This command can continue to run the process after you exit the account/close the terminal. Nohup is the meaning of not hanging (no hang up).
There are two ways to use it in general:
nohup command or NOHUP command &
The difference between this is the command line with &, even if the terminal (terminal) shuts down, or the computer crashes the program is still running (if you submit the program to the server);
The problem with it is that it seems convenient to output standard output (STDOUT) and standard error (STDERR) results to nohup.txt files, but when the output is large, the Nohup.txt file will be very large, or multiple background commands will be output to the Nohup.txt file, not Facilitates finding results and debugging programs.
For related information, please refer to: http://www.2cto.com/os/201301/185701.html
Kill–hup Process ID Hot Upgrade
First with Ps-ef | The grep app name finds the process ID where the app resides.
Want to simply stop and restart the process. As follows:
# Kill-hup PID
This command shuts down the Linux gentle execution process and then restarts immediately. This command is handy when configuring the application, which can be executed when the configuration file is modified to restart the process.
Note that the restart process is re-reading the configuration file.
Reference: HTTP://BEEGO.ME/DOCS/ADVANTAGE/RELOAD.MD
Crontab Scheduled Tasks
Add Crontab Task
For crontab tasks There are two ways, one for root users can be added directly, one for non-root users need crontab-e way to add; As the root user, for example, execute the following command:
Vi/etc/crontab
Add one at the bottom:
3 4 * * * command to be executed
It means that the file is executed at 4:3 every day;
Write well after saving exit crontab.
Restart Crontab Service
/etc/init.d/crond restart
Reference: http://jingyan.baidu.com/article/11c17a2c796354f446e39ded.html
How to see if the Crontab timed task executes
Query methods for Linux systems (including Redhat, SUSE)
See/var/log/cron This file can be, can use tail-f/var/log/cron observation
If you see something like the following in this file see:
Sep 10:40:02 Dev crond[30256]: (Root) CMD (/usr/local/mysql-standard-5.0.26-linux-i686/collectiondatabackup/ collectiondatabackup.sh)
Sep 10:40:03 Dev crond[30255]: (root) MAIL (mailed 376 bytes of output but got status 0x0047)
This indicates that the message of the program execution feedback has been sent by mail, but the problem with mail is not set. Of course, if sent, you can go to the following directory to see the implementation of the prompt message:
Mail Task (Linux UNIX) in the/var/spool/mail/root file, there is a record of the crontab execution log, with tail-f/var/spool/mail/root to view recent crontab executions.
Reference: http://jingyan.baidu.com/article/73c3ce28e7b298e50343d925.html
Tail command parameters See: http://www.2cto.com/os/201111/110143.html
If you do not want to use mail, you can control the execution output to a file, self-view. Similar to the following methods:
0 * * */opt/oracle/rmanbackup.sh >/home/oracle/backup.log 2>&1
Upload rz and download sz
SZ: Send the selected file (send) to the local machine
RZ: Run this command will pop up a file Selection window, from the local select File upload to the server (receive)
Reference: http://www.cnblogs.com/ghj1976/p/3742062.html