One, the sh script is as follows:#!/bin/shlocation= "/home/sharedir/" Find $location-mtime +30-type f |xargs rm-fSave named Del.shThe other two ways to find related files are as follows:1) Find /home/sharedir/ -mtime +30-type f-name *.gz2) find/home/sharedir/-mtime +30-type F |xargsSecond, the use of CRONTAB-E timed start del.sh script*/10 * * * */bin/sh/home//del.sh1) crontab-l Show your crontab file2) cro
SH file for full backup: exp_comp.sh
rq= ' date + '%m%d '
SU-ORACLE-C "Exp System/manager full=y inctype=complete file=/oracle/export/db_comp$rq.dmp"
SH file for cumulative backup: exp_cumu.sh
rq= ' date + '%m%d '
SU-ORACLE-C "Exp System/manager full=y inctype=cumulative file=/oracle/export/db_cumu$rq.dmp"
SH file for incremental backups: exp_incr.sh
rq= '
Oracle 11g RAC executes root. sh encountered CRS-0184/PRCR-1070 problems Oracle 11g RAC installation, at the first node execute root. sh encountered a CRS-0184/PRCR-1070, Google a lot of posts have not found a solution. Hey, let's calm down and look at the log !! The conclusion is a casual problem, as described below. 1. Fault
[Python] # installation environment [root @ linux1 ~] # More/etc/issue Enterprise
. PL execution failed
127.0.0.1 loopback localhost # loopback (lo0) Name/address: 1 loopback localhost # IPv6 loopback (lo0) Name/addressxxxxxxxxxxx localhost found that an IP address alias in the/etc/hosts file is localhost, there are both sides. Delete the row and run root again. sh
[Email protected]:/oraapp/GRID/gridhome>./root. shmongoming root user operation for Oracle 11g
The following environment variables are set as: oracle_owner = grid ORAC
Usage. sh,######################################## ################################## File Name: usage. sh# Author:# Mail:# Created Time: Friday, January 1, December 05, 2014 seconds######################################## ##################################! /Bin/bashIf [-z "$1"]; thenEcho-e "Usage: \ n \ t ${0 # */} Exit 1FiEcho-e "\ n To find the result in your desired result.txt \ n":> Zookeeper result.t
Oracle Rac root. sh error: Failed to create keys in the OLR, rc = 127 libcap. so.1, root. sholrEnvironment Description: Linux 6.3 Oracle Rac 11.2.0.4[Root @ web1 grid] #/u01/app/11.2.0/grid/root. shmongoming root user operation for Oracle 11gThe following environment variables are set as: ORACLE_OWNER = grid ORACLE_HOME =/u01/app/11.2.0/gridEnter the full pathname of the local bin directory: [/usr/local/bin]: Copying dbhome to/usr/local/bin... copying
The latest cocos2d-x version is 2.1.3, Which is okay when build_native.sh is called, but the following error occurs when build_native.sh clean.
Clean: chipmunk_static [armeabi]/bin/sh:-C: line 0: syntax error near unexpected token '('/bin/sh:-C: line 0: 'rm-RF (target_objs) 'Make: *** [clean-chipmunk_static-armeabi] Error 2
Check, it turned out that this is a bug of ndk, find the build/CORE/build-bina
Zookeeper
Oradebug. sh: Here is an OS Information Collection script, which is stored on the computer and cannot be found next time. It is recorded here.
#! /Usr/bin/ksh######################################## ############################### Osdebug. sh## VARIABLESLOG = "$ HOME/osdebug _ 'date-u + '% h _ % d _ % Y _ % H. out ''"INTERVAL = 60NETSTAT = "/bin/netstat-ais"IOSTAT = "/usr/bin/iostat-x"VMSTAT = "/u
There is no multiline comment in sh, only one # is added to each line. Can only be like this:
#--------------------------------------------
# This is a script that automatically plays IPA, based on Webfrogs's ipa-build writing:
# https://github.com/webfrogs/xcode_shell/blob/master/ipa-build
# features: Automatic packaging for Etao iOS app, 14 channels of output IPA package
# Features: automatic packaging, no
In linux, how does one regularly run the sh script? -- Linux general technology-Linux programming and kernel information. The following is a detailed description. My script is:
#! /Bin/bash
Cp-a/data/mysql/mnt/mysqldata
Tar-czvf/mnt/mysql _ $ (date + "% Y % m % d" 2.16.tar.gz/mnt/mysqldata
Rm-fr/mnt/mysqldata
Regularly let him start running at every Sunday, only once. I set it to * 3 ** 0/root/backup. sh
Often, daily or weekly is used to do some work. If you can use scripts to organize these jobs and execute them automatically, it will save a lot of effort.
Here are some common commands.
1. Tee outputs the execution result of a sh to the specified file
./Redeploysc. Sh | tee 'date + "% Y % m % d _ % H _ % m" '.txt
2. Read the value of a file and assign it to a variable.
Cur_build_dir = 'cat/mnt/11
1 OpeningThe program must start with the following line (must be in the first line of the file):#!/bin/shThe symbol #! is used to tell the system that the parameter behind it is the program used to execute the file. In this example we use/BIN/SH to execute the program.When writing a script, you must also make it executable if you want to execute the script.To make the scripting executable:Compile chmod +x filename so you can use./filename to run2 Note
Step 1: Create an SH batch command file# vim/etc/batch_ssh/install_redis.shStep 2: To the current user, be able to execute SH script permissions# chmod install_redis.sh 777Step 3: Write the command to be executed in bulk, read to wait for the front-end user input, and sleep to indicate the wait time in seconds.echo ' \ n begin to install plugin \ n '; yum install Cpp-y;echo ' \ n Yum finish install plugin \
Wrote a script to stop MongoDB, the code snippet is as follows:1#!/bin/Bash2 3 # Stop MONGO4Echo"Stop MongoDB ..."5Mongo_pid= ' Ps-ef | grep Mongod | Grep-v grep | Awk'{print $}'`6 if[[A${mongo_pid} = = A"' ]]7 Then8Echo"MongoDB is not running ..."9 ElseTenKill-2${mongo_pid} OneSleep5 A ifPs-ef | Grep-v grep | grep-Q Mongod - Then -Echo"MongoDB Stop failed" the Else -Echo"MongoDB Stop Successful" - fi -FiThe execution method isSH stop.shPerform normally on CentOS and execute on Ubuntu
Originally this year, Chiang has plans to learn the contents of Linux script, so in a variety of books in the previous activities to buy a lot of books, but most of the plastic cover has not been demolished. Today, the company has no business, so try to toss back the script, although there are some references on the Web documents, but at any time also need to explore their own side and modify to more convenient for our general purpose of the script.
Many of our friends play Linux scri
First of all, let's look at the problem description, the following figure is my run-time error screenshot:
Solving method
Analyze the reason, maybe because I have a problem with my platform migration, we have permission to convert.
1 conversion under Windows:
Use tools such as UltraEdit or editplus to convert scripts to code and then execute them in Linux. The conversion method is as follows (UltraEdit): File-->conversions-->dos->unix.
2) method
Use VIM to open the
==========rpm============
1 Install Alien and Fakeroot first:
sudo apt-get install alien Fakeroot
2 convert rpm files to Deb
Fakeroot Alien xxx.rpm
3 Installing Deb
sudo dpkg-i xxx.deb
=========tar.gz===============
tar.gz installation, this thing online more is, just this evening, I learned, send up for everyone referenceTo install the tar file, unzip it first.Terminal input: sudo tar-zxvf compressed file name. tar.gz/tmp (False assumption to the/tmp directory),Then after th
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.