Sponsored Content
Top Forums Shell Programming and Scripting Simple script? First timer... Post 302227481 by zawmn83 on Thursday 21st of August 2008 09:42:34 AM
Old 08-21-2008
put in rc.local

Hi
I also have a process that trigger every one minute. I use sleep function in script with infinite loop.

while [ 1 -lt 2 ]
do
clear
file=0
killall -u `whoami` -q soffice
soffice -invisible -norestore -nofirststartwizard -nologo -headless "-accept=socket,host=localhost,port=8100;urp;" &
sleep 15s
find /temp/papers/ -name *^.doc | while read a;
do
file=$(($file+1))
filename=`echo "$a" | sed 's/\(.*\)...../\1/'`
echo Converting $filename.doc
python DocumentConverter.py "$filename^.doc" "$filename.pdf"
errorcode=$?
if [ $errorcode -eq 0 ]; then
mv "$a" "$filename.doc"
echo Successfully Convert $filename.doc
fi
if [ 0 -lt $errorcode ]; then
echo Can not convert $filename.doc error $errorcode
fi
done
killall -u `whoami` soffice
echo Total files: $file
echo Waiting for next interval
sleep 60s
done

I run the above script from Terminal, it is working fine.
I would like to start this process automatically on my linux startup.
So I put calling my script file in /etc/rc.d/rc.local.
When I reboot, OS hang on startup. I think OS is looping infinite loop of my script.

How can I solve?

Thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

script run timer

any of you guys have a script for measuring the run time of any given script, where you would sandwich your own script between the timer script or something? thanks! :) (2 Replies)
Discussion started by: mark_nsx
2 Replies

2. Shell Programming and Scripting

Timer

Is there a way to make a timer? E.g Please give the seconds... ... (6 Replies)
Discussion started by: aekaramg20
6 Replies

3. Shell Programming and Scripting

Startup Script "run process with Timer"

Hi I have a script that execute every X minute for checking new files in a folder and converting to pdf. Is there any way to start this script automatically on linux startup?. I use sleep function in script with infinite loop. while do killall -u `whoami` -q soffice soffice... (0 Replies)
Discussion started by: zawmn83
0 Replies

4. UNIX for Dummies Questions & Answers

Timer

is there a timer function in unix without using C? for example i want to display a message after 5 seconds how do i do that? (2 Replies)
Discussion started by: khestoi
2 Replies

5. Shell Programming and Scripting

60 second Timer with Shell Script

Please how can i display a 60 second active countdown timer in an echo message. (7 Replies)
Discussion started by: frankycool
7 Replies

6. Shell Programming and Scripting

Perl script timer on program launch

So I am attempting to get a short but complex perl script to be able to time out an application that I will launch from a command line. The terminal I use is MKS C SHELL and I am having trouble doing the a job spawn that will launch the application and keep time on it. I know you could do this... (1 Reply)
Discussion started by: vas28r13
1 Replies

7. UNIX for Dummies Questions & Answers

Shell Script / Timer

Hey folks, We already got a working Script running, but actually we gotta start it manually but at least we want to run it like every 30minutes 1time. Could anyone give it a shot? #!/bin/sh for i in A B C D E F G H I J K L M N O P Q R S T U V W X Z do ln -sv /x/$i/*/PDF/001-*.*... (1 Reply)
Discussion started by: Yjerith
1 Replies

8. Shell Programming and Scripting

Help making simple perl or bash script to create a simple matrix

Hello all! This is my first post and I'm very new to programming. I would like help creating a simple perl or bash script that I will be using in my work as a junior bioinformatician. Essentially, I would like to take a tab-delimted or .csv text with 3 columns and write them to a "3D" matrix: ... (16 Replies)
Discussion started by: torchij
16 Replies

9. Shell Programming and Scripting

Looping in the shell script with help of script timer.

Hello Experts- We are facing some issues in the while loop script when we use the script time to decide whether to exist from the loop or continue. Below is the script SrcExitLoop="FALSE" Src_InitialStartTime=`date +%s` Src_StartTime=`date +%s` Src_NUM_ALERTS=0 TOTAL_ALERTS=`expr <SOME... (4 Replies)
Discussion started by: Amey Joshi
4 Replies

10. UNIX for Dummies Questions & Answers

Help please with FTP timer script

Hi Could somebody please help me with this code? ------------------------------------------ @ftp -i -s:"%~f0"&GOTO:EOF open mysite.co.uk myusername mypassword !:--- FTP commands below here --- cd public_html/ binary lcd c:\ put myfile.jpg bye ... (3 Replies)
Discussion started by: dobbies
3 Replies
ooffice(1)							   User Commands							ooffice(1)

Name
       ooffice - OpenOffice.org office suite

SYNOPSIS
ooffice [-accept=accept-string] [-base] [-calc] [-display display] [-draw] [-global] [-headless] [-help|-h|-?] [-impress] [-invisible] [-math] [-minimized] [-n filename] [-nodefault] [-nolockcheck] [-nologo] [-norestore] [-o filename] [-p filename...] [-pt printername filename...] [-show presentation] [-unaccept=accept-string] [-terminate_after_init] [-view filename] [-web] [-writer] [filename...] oobase oocalc oodraw oofromtemplate ooimpress oomath ooweb oowriter DESCRIPTION
OpenOffice.org is a fully featured office suite for the daily use with all features you would normally expect in a office suite. This script runs OpenOffice with the arguments <args> given on the command line. There are also some wrapper scripts in /usr/bin which run the wanted OpenOffice.org module. OPTIONS
filename... Files to operate on. Opening them is the default behavior, which can be influenced by command line arguments. -p will print the files instead. -accept=accept-string Notifies the OpenOffice.org software that upon the creation of "UNO Acceptor Threads", a "UNO Accept String" will be used. -base Starts with the database wizard. -calc Starts with an empty Calc document. -display display This option specifies the X server to contact; see X(7) -draw Starts with an empty Draw document. -global Starts with an empty Global document. -headless Starts in "headless mode", which allows using the application without user interface. This special mode can be used when the application is controlled by external clients via the API. -help|-h|-? Lists the available OOo-native command line parameters to the console. -impress Starts with an empty Impress document. -invisible Starts in invisible mode. Neither the start-up logo nor the initial program window will be visible. However, the OpenOffice.org software can be controlled and documents and dialogs opened via the API. When the OpenOffice.org software has been started with this parameter, it can only be ended using the taskmanager (Windows) or the kill command (UNIX based systems). It cannot be used in conjunction with -quickstart. -math Starts with an empty Math document. -minimized Keep the splash screen minimized. -n filename Creates a new document using filename as a template. -nodefault Starts the application without any window opened for the first time. A window appears if you start the office next time. It is used together with the option -nologo by quickstarters. Note that the option -quickstart has not been longer supported since OpenOffice.org 2.0.0. -nolockcheck Disables the check for remote instances using the installation. -nologo Disables the splash screen at program start. -norestore Disables restart and file recovery after a system crash. It is possible OOo will try to restore a file it keeps crashing on, if that happens -norestore is the only way to start OOo. -o filename Opens filename for editing, even if it is a template. -p filename... Prints the given files to the default printer and ends. The splash screen does not appear. If the file name contains spaces, then it must be enclosed in quotation marks. -pt printername filename... Prints the given files to the printer printername and ends. The splash screen does not appear. If the file name contains spaces, then it must be enclosed in quotation marks. -show presentation Starts with the given Impress file and starts the presentation. Enters edit mode after the presentation. -unaccept=accept-string Closes an acceptor that was created with -accept option. Use -unaccept=all to close all open acceptors. -terminate_after_init The office terminates after it registers some UNO services. The office doesn't show the intro bitmap during startup. -view filename Creates a temporary copy of the given file and opens it read-only. -web Starts with an empty HTML document. -writer Starts with an empty Writer document. TROUBLESHOOTING PROBLEMS
See http://en.opensuse.org/Bugs:OOo for more details about how to report bugs in OpenOffice.org. SEE ALSO
http://go-oo.org/ AUTHOR
This manual page was created by Rene Engelhard <rene@debian.org> for the Debian GNU/Linux Distribution, because the original package does not have one. It was updated for Novell by Petr Mladek <petr.mladek@novell.com>. OpenOffice.org 2008-11-19 ooffice(1)
All times are GMT -4. The time now is 10:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy