sh

Setting Cron Job in AWS EC2 instance

点点圈 提交于 2019-12-25 04:09:16
问题 I've created a cron job in AWS EC2 but it is not working. I followed below steps to create cron tab: Step 1: I logged in to AWS EC2 Instace step 2: sudo su step 2: crontab -e Step 3: Insert mode Step 4: I entered # M H DOM M DOW CMND 15 14 * * 3 /services/backup.sh >/tmp/error.log 2>&1 Step 5: :wq Cron tab is created but not running. Please can you any one help me , why it is not working? UPDATE : after lots of researching i found that i can give a log to the particular cron file so added >

work on manual query but not work at bash sh file

帅比萌擦擦* 提交于 2019-12-25 03:53:10
问题 i just test this on query ( sysyoq ) it work but when i put it on sh file error #!/bin/bash lalu=$(date -d"1 month ago" "+%Y-%m-%d") skrg=$(date '+%Y%m') datenowone=$(date '+%Y-%m-01') datenowtoday=$(date '+%Y-%m-%d') set `date +%m" "%Y` CURMTH=$1 CURYR=$2 if [ $CURMTH -eq 1 ] then PRVMTH=12 PRVYR=`expr $CURYR - 1` else PRVMTH=`expr $CURMTH - 1` PRVYR=$CURYR fi if [ $PRVMTH -lt 10 ] then PRVMTH="0"$PRVMTH fi mysql -h10.251.38.76 -umcd_metro -pBismillah2013 testarea -e "TRUNCATE TABLE testarea

: command not foundop/dominio.sh: line 2:

a 夏天 提交于 2019-12-25 02:41:12
问题 I'm writing shell scripting for Mac. Here's my script: echo "Bienvenido"; /Applications/sdk/platform-tools/adb devices; sudo /Applications/sdk/platform-tools/adb shell input text 'sp.soporte@gmail.com'; It realize the correct operation, but here is the output : $ /Users/julien/Desktop/dominio.sh Bienvenido : command not foundop/dominio.sh: line 1: List of devices attached 4790057be1803096 device : command not foundop/dominio.sh: line 2: : command not foundop/dominio.sh: line 3: julien$ If I

Shell script to replace a class file

孤街醉人 提交于 2019-12-25 02:32:59
问题 I have read many posts about changing the contents of a file and replace the whole file, but little did I understand. Referred this too. The .sh is the one that confuses me. Do I need to use .sh in my case too. I don't want to ruin the project by trying something new, without much understanding. How do I replace a class file in a jar? I have the class file ready from my workspace. All I need to do is replace the already present class file in the jar. Moreover, need I restart the server after

.bat to .sh converting for SQL*Loader Start on UNIX PC

為{幸葍}努か 提交于 2019-12-25 02:15:06
问题 I have a simple .bat file @echo; set nls_lang=russian_cis.ru8pc866 @echo off SET NLS_NUMERIC_CHARACTERS=. ' sqlldr.exe userid=PRB/0611@TSESTDB control=control_file.ctl LOG=fdb_log.log errors=100 cmd and i need to convert to .sh file for running on the UNIX based pc. I began to read "BASH Programming - Introduction HOW-TO" (is it suitable for beginners?), but it is a episodical task and dead line comes. Could anybody help me to convert file? Thanks a lot!!! 回答1: rewriting your script. #!/bin

Execute sh file from Java

与世无争的帅哥 提交于 2019-12-25 00:36:38
问题 I am trying to execute an sh file via the following code (CentOS machine btw) Runtime.getRuntime().exec("sh " + file.getPath()); I use this code for windows and it works fine Runtime.getRuntime().exec("cmd /c start " + file.getPath()); Could it be because I'm using Screen in the .sh file? I am also using the java command to start the server so maybe I need to include these? Here are the contents of the sh file #!/bin/sh BINDIR=$(dirname "$(readlink -fn "$0")") cd "$BINDIR" screen -S

Changing a directory of the parent shell [duplicate]

余生颓废 提交于 2019-12-25 00:01:44
问题 This question already has answers here : Why doesn't “cd” work in a shell script? (29 answers) Closed last year . I 'm wondering of any mechanism that one could use to change the directory of a parent shell from sub-shell. For ex., I 'm running the script "settings.sh" in my $HOME. My $HOME has a directory $HOME/TEST/run. If my "settings.sh" scripts is as below #!/bin/bash # some shell related code # some shell related code cd $HOME/TEST/run exit 0 I execute the above script at command prompt

bash script to select multiple file formats at once for encode process

喜夏-厌秋 提交于 2019-12-24 23:09:22
问题 I have a BASH script I downloaded (that works) to do some video conversions using handbrake-CLI but at the moment it only allows conversion from a single file format at a time avi to mkv only. I would like to be able to have it convert any type of input file (avi,wmv,flv...to mkv ) all at once instead of changing the script each time for each input format. How can I adjust the bash script to allow this? So how can I get this bash script with the line input_file_type="avi" to work with input

How to run these set of sh commands in bat file?

倖福魔咒の 提交于 2019-12-24 21:21:53
问题 I need to run this sh commands. First, the command will be this one keytool -importcert -file myfile.cer -keystore keystore.jks -alias "Aliasname" Enter keystore password: Re-enter new password: Trust this certificate? [no]: I need to run this commands automatically, And when the first command is successful. It asks for a password. I need to enter it automatically. and finally yes. How to do that using .bat file? 回答1: If keytool is compliant with standard input, you can use: ( echo your

reading a timestamp file and creating a directory structure depends upon the timestamp

柔情痞子 提交于 2019-12-24 18:33:56
问题 I have log files for year's data , I want to read inside the log file and take the unix timestamp column and convert to human readable timestamp(not literally, only logically) . Depends on the timestamp . I want to create a Time based directory structure Something like this ( 2017/05/20/13 ) (YYYY/MM/DD/HH) and copy those files to respective directory structure LANG=C if [[ -z "$1" ]] then if [[ -p /dev/stdin ]] # input from a pipe then read -r p else echo "No timestamp given." >&2 exit fi