Sponsored Content
Top Forums Shell Programming and Scripting how can i check if text file is closed ? Post 302078586 by umen on Monday 3rd of July 2006 03:09:44 AM
Old 07-03-2006
so what will be the best way to check if file is still being copied?

i dont see any option with using the fuser
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to check if a unix text file is being accessed?

I am writing a script that periodically reads in data from a text file. The only issue is that, that text file is periodically updated (appended to) by another script. I am using perl in UNIX environment. How can I check if that text file is being accessed, so I can wait until it is no longer being... (6 Replies)
Discussion started by: rickylui
6 Replies

2. UNIX for Advanced & Expert Users

How to check a file in UNIX is closed or growing?

We have a third party tool in UNIX to kick off a 'file copy' job based on a file existance. If a specific file exists in an UNIX directory, another process should start copy the file into another system for further processing. The issue is, the copy job is starting as soon as the file exists in... (6 Replies)
Discussion started by: kslakshm
6 Replies

3. Shell Programming and Scripting

Need a script that will check for changes in a text file

Hi Everyone, Can someone please show me how to create a script that will search a text file for changes. For example below is a sample of how the text file would look like, RLH rlh-1 ALIVE 20:06:05 RLH rlh-7 ALIVE 20:06:05 RLH rlh-3 ALIVE ... (7 Replies)
Discussion started by: kumaran21
7 Replies

4. Shell Programming and Scripting

Check if a text file is empty or not (using ls -s)

Hello, I want to make a script which says if a text file is empty or not. I tried two ways of making it, but I have problems with both of them. Now I think that the better way is the ls -s solution (considering that an empty text file has a 0 weight, because "cat file.txt" fails when file is... (4 Replies)
Discussion started by: Link_
4 Replies

5. Shell Programming and Scripting

shell script to take input from a text file and perform check on each servers and copy files

HI all, I want to script where all the server names will be in a text file like server1 server2 server3 . and the script should take servernames from a text file and perform copy of files if the files are not present on those servers.after which it should take next servername till the end of... (0 Replies)
Discussion started by: joseph.dmello
0 Replies

6. Shell Programming and Scripting

need to wait until Text Editor is closed

Hi, I am writing an SH script where I need to open text editor from within the script and wait until the user closed or quit text editor. And then execute consecutive commands. Here is a very simplified example: gedit data.txt # ---- wait until Text editor is exited echo "Text Editor is... (1 Reply)
Discussion started by: dd_u_dev1982
1 Replies

7. Shell Programming and Scripting

Shell program to check if the same text appears twice in an XML file

Hi All, I am very new to this forum and beginner to shell scripting. I need a shell script to: Search for a text in XML file à if the same text appears twice in an XML file à output file name Script should loop thru every xml file of a given folder. Please help me writing this script. ... (1 Reply)
Discussion started by: amardeep001
1 Replies

8. Shell Programming and Scripting

Check if the text file has more than 2 characters

Guys, I know that the below command will cut the 13th field from test.txt file awk -F"|" '{print $13}' test.txt The answer would be, CA CN Ohio If we see the 3 rd one, it has more than 2 characters. So i wanted to check this in if condition and i want to get the output if the 13th... (4 Replies)
Discussion started by: AraR87
4 Replies

9. Shell Programming and Scripting

[Solved] Replacing line of text while file is closed

Is it possible to replace a line of text within a file while it's closed with a single command or a script? Please show me an example or point me to a webpage that shows an example. The file has this line of text: LoginGraceTime 100 I want to replace it with the following: ... (2 Replies)
Discussion started by: wdg74
2 Replies

10. Shell Programming and Scripting

Check if files inside a text file are found under a directory

Hi all, Please somebody help me with this: I want to check if the files listed in a text file, are found under a directory or not. For example: the file is list_of_files.txt, which contains inside this rows: # cat list_of_files logs errors paths debug # I want to check if these... (3 Replies)
Discussion started by: arrals_vl
3 Replies
Mojo::Server::Daemon(3pm)				User Contributed Perl Documentation				 Mojo::Server::Daemon(3pm)

NAME
Mojo::Server::Daemon - Non-blocking I/O HTTP 1.1 and WebSocket server SYNOPSIS
use Mojo::Server::Daemon; my $daemon = Mojo::Server::Daemon->new(listen => ['http://*:8080']); $daemon->unsubscribe('request'); $daemon->on(request => sub { my ($daemon, $tx) = @_; # Request my $method = $tx->req->method; my $path = $tx->req->url->path; # Response $tx->res->code(200); $tx->res->headers->content_type('text/plain'); $tx->res->body("$method request for $path!"); # Resume transaction $tx->resume; }); $daemon->run; DESCRIPTION
Mojo::Server::Daemon is a full featured non-blocking I/O HTTP 1.1 and WebSocket server with "IPv6", "TLS" and "libev" support. Optional modules EV, IO::Socket::INET6 and IO::Socket::SSL are supported transparently and used if installed. Individual features can also be disabled with the "MOJO_NO_IPV6" and "MOJO_NO_TLS" environment variables. See Mojolicious::Guides::Cookbook for more. EVENTS
Mojo::Server::Daemon inherits all events from Mojo::Server. ATTRIBUTES
Mojo::Server::Daemon inherits all attributes from Mojo::Server and implements the following new ones. "backlog" my $backlog = $daemon->backlog; $daemon = $daemon->backlog(128); Listen backlog size, defaults to "SOMAXCONN". "group" my $group = $daemon->group; $daemon = $daemon->group('users'); Group for server process. "inactivity_timeout" my $timeout = $daemon->inactivity_timeout; $daemon = $daemon->inactivity_timeout(5); Maximum amount of time in seconds a connection can be inactive before getting closed, defaults to the value of the "MOJO_INACTIVITY_TIMEOUT" environment variable or 15. Setting the value to 0 will allow connections to be inactive indefinitely. "ioloop" my $loop = $daemon->ioloop; $daemon = $daemon->ioloop(Mojo::IOLoop->new); Loop object to use for I/O operations, defaults to the global Mojo::IOLoop singleton. "listen" my $listen = $daemon->listen; $daemon = $daemon->listen(['https://localhost:3000']); List of one or more locations to listen on, defaults to the value of the "MOJO_LISTEN" environment variable or "http://*:3000". # Listen on IPv6 interface $daemon->listen(['http://[::1]:4000']); # Listen on two ports with HTTP and HTTPS at the same time $daemon->listen([qw(http://*:3000 https://*:4000)]); # Use a custom certificate and key $daemon->listen(['https://*:3000?cert=/x/server.crt&key=/y/server.key']); # Or even a custom certificate authority $daemon->listen( ['https://*:3000?cert=/x/server.crt&key=/y/server.key&ca=/z/ca.crt']); These parameters are currently available: "ca" Path to TLS certificate authority file. "cert" Path to the TLS cert file, defaults to a built-in test certificate. "key" Path to the TLS key file, defaults to a built-in test key. "max_clients" my $max_clients = $daemon->max_clients; $daemon = $daemon->max_clients(1000); Maximum number of parallel client connections, defaults to 1000. "max_requests" my $max_requests = $daemon->max_requests; $daemon = $daemon->max_requests(100); Maximum number of keep alive requests per connection, defaults to 25. "silent" my $silent = $daemon->silent; $daemon = $daemon->silent(1); Disable console messages. "user" my $user = $daemon->user; $daemon = $daemon->user('web'); User for the server process. METHODS
Mojo::Server::Daemon inherits all methods from Mojo::Server and implements the following new ones. "run" $daemon->run; Run server. "setuidgid" $daemon = $daemon->setuidgid; Set user and group for process. "start" $daemon->start; Start accepting connections. DEBUGGING
You can set the "MOJO_DAEMON_DEBUG" environment variable to get some advanced diagnostics information printed to "STDERR". MOJO_DAEMON_DEBUG=1 SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>. perl v5.14.2 2012-09-05 Mojo::Server::Daemon(3pm)
All times are GMT -4. The time now is 07:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy