#!/bin/bash cd /home/database
command 1
if [ today is monday ]
then
nohup monday &
fi
repeat for other days of the week.
......
exit 0
Code:
#monday
current_time=hour * 3600 +min *60 +sec
runtime=19*3600
if current_time less than runtime
sleep (runtime - current_time)
do stuff
else
echo too late for today
fi
---------- Post updated at 10:35 PM ---------- Previous update was at 10:16 PM ----------
Not sure if you are still after this or in the meantime something else. (It might be beneficial to describe in plain text what exactly you want to do and maybe we find a better solution with a completely different way of attacking this.)
Quote:
Originally Posted by baris35
Code:
command 1
if time is 19:00, day is Monday then run command2
if time is 20:00, day is Tuesday, then run command3
if time is 22:00, day is Friday, then run command4
if time is 00:00, day is Thursday, then run command5
This can easily be done with several cron jobs and you don't need a script for it. Put the following in crontab:
Hello Bakunin,
Thanks for the info you shared. I am a bit familiar with crontab. I am not sure that I can do what I am trying to do exactly. Let me go in deeper to make it more clear:
my script
Code:
cd folderA
For i in *.mp4
do
ffmpeg -i $i -c copy -f mpegts pipe:1
done
if time is 19:00, go to folder B
ffmpeg -i 1.mp4 -c copy -f mpegts pipe:1
mv 1.mp4 /played_video/1.mp4
when 1.mp4 ends,
ffmpeg -i 2.mp4 -c copy -f mpegts pipe:1
mv 2.mp4 /played_video/2.mp4
if time is 21:30 go to folder A
for i in *.mp4
do
ffmpeg -i *.mp4 -c copy -f mpegts pipe:1
done
Here is the explanation of my aim in text plain.
I need to make the script running in FolderA and play all video files, one by one, without interruption. When time is 19:00, it should suddenly stop playing the mp4 files in FolderA and should go to FolderB. Then stream 1.mp4 and pipe it. when 1.mp4 finishes, move it to the folder played_video, then stream 2.mp4 with ffmpeg in pipe mode. When stream process of 2.mp4 is finished, move it to played_video folder etc..
Then go back to folderA and keep streaming all files.
As I am piping in folder B, for some reason, I am also unable to move processed file at the end of each process.
I am trying to run an awk command inside of ssh and it is not working. These are AIX servers.
for i in `cat servers`; do ssh $i "/bin/hostname; df -g | awk '/dev/ && $4+0 > 70'"; done
server1
server2
server3
server4
I also tried these two methods and they did not work. It just seemed... (5 Replies)
I have bash shell script which is internally calling python script.I would like to know how long python is taking to execute.I am not allowed to do changes in python script.Please note i need to know execution time of python script which is getting executed inside shell .I need to store execution... (2 Replies)
Hi,
I would like to run following code in bash inside a zsh script. (In this case is output unfortunately very different if you run it in zsh).
I tried to put "bash" in front of the code but I obtained following error message "bash: do: No such file or directory
" eve though I merged the whole... (7 Replies)
I have to run some shell scripts in Windows using Cygwin. I am able to achieve that using
%BASH% --login -i "/cygdrive/d/script.sh"
, where %BASH% is an environment variable in Windows set to
C:\cygwin\bin\bash.exe.
I have a created a Cygwin environment variable $EXE_PATH =... (3 Replies)
There's a JavaScript file that I call from command line (there's a framework) like so:
./RunDiag.js param1:'string one here' param2:'string two here'
I have a shell script where I invoke the above command. I can run it in a script as simple as this
#!/bin/bash
stuff="./RunDiag.js... (4 Replies)
Hi everyone,
when executing this command in unix:
echo "WM7 Fatal Alerts:", $(cat query1.txt) > a.csvIt works fine, but running this command in a shell script gives an error saying that there's a syntax error.
here is content of my script:
tdbsrvr$ vi hc.sh
"hc.sh" 22 lines, 509... (4 Replies)
I have a command which will run fine in a unix command prompt. Can you tell how to interprete this command inside perl script......
The command is :
perl -pe 's/(\|333\}.*)\}$/$1|1.6}/' FIA.txt
This will search for the number 333 and appends 1.6 at the end of that line....... (1 Reply)
How do I create a K Shell which would silently (without user input) logon to Oracle and
run an SQL script?
Any help will be greatly appreciated.
Steve (1 Reply)