05-22-2009
How to lock an inbox using UNIX scripting
Hi All,
I have an inbox , which recieves mails every second. I need to copy the contents of the mails in the inbox to a file , say once every minute. Then clear the content of the inbox. There is a possibility that a new mail might come in before I delete the content.
Please let me know if there is a way to lock the inbox , so that no new mails come in , and they are queued up , till the time the lock is released.In that time gap I will copy and clear the contents of the inbox without loosing any mails.
This is bit urgent , so please help me in this. Also I not well versed in UNIX scripting.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
We wish to keep a sequence number in a file. When someone wants to get the next sequence number we need to lock the file, get the next number and increment it by one. How do you do that?
I know how to get the number and increment it but how do I lock the file and test that it is locked or not... (1 Reply)
Discussion started by: tammy_schmuki
1 Replies
2. UNIX for Dummies Questions & Answers
how can I lock my keyboard while I'm away from the computer without using lock command. What other commands gives me the option to lock keyboard device?
thanks (7 Replies)
Discussion started by: dianayun
7 Replies
3. UNIX for Dummies Questions & Answers
I want to programatically delete a mail from my inbox(preferrably through perl).
Is there any unix command for the same or do we have some perl modules which can do this job. (3 Replies)
Discussion started by: xsriniva
3 Replies
4. Shell Programming and Scripting
I am a new user of linux. I have 2 Queries
1) I recently started working with shell script, and now i plan to make a folder lock using a shell script. I have ubuntu 8.04 installed on my system.
2) When i searched on this forum all i got was mini-httpd, and apache2-utils package, but they... (2 Replies)
Discussion started by: tsunami
2 Replies
5. Shell Programming and Scripting
Hi,
How can we apply lock on a text file through Unix Ksh script. I did found a command flock (file descriptor) but am not very acquainted with the usage.
Can anybody tell me if I need to use Flock command for applying locks to a file while writing on it. If the person can explain the usage... (3 Replies)
Discussion started by: kum5256
3 Replies
6. Shell Programming and Scripting
My requirement is
I need to write a program in shell scripting to check 2 TCP unused unique port numbers in SOLARIS and I have to lock the same ports so that it will not be used in any other new process and the same port numbers should be used and locked in the LINUX machine to communicate... (2 Replies)
Discussion started by: sreeramr30
2 Replies
7. Red Hat
Hello all,
If anyone has time, I have a few questions:
How do I do the following in Linux. We are using Red Hat and Oracle Enterprise Linux, which is based on Red Hat too.
1. How to lock the account after a few (like 3) invalid password attempts?
2. How do you lock a screen after 30... (1 Reply)
Discussion started by: nstarz
1 Replies
8. UNIX for Advanced & Expert Users
Hi all,
I have to test some user priviliges. The goal is to be sure that an unauthorized user can't restart some modules (ssh, mysql etc...).
I'm trying to automate it with a shell script but in same cases I got the syslog broadcast message.
Is there any way to simply get a return code... (3 Replies)
Discussion started by: Dedalus
3 Replies
9. Shell Programming and Scripting
Hi frndz,
Can anyone provide me some input or pseudo code for my req as mentioned below...
I am loading 2 files through unix script into oracle table...as i am doing some updates also i am getting an error where both files try to update the table simultaneously and my script fails..
so i... (3 Replies)
Discussion started by: gnnsprapa
3 Replies
10. Ubuntu
I wrote two shell scripts in UNIX that renames the same file and scheduled them at the same time.
The following are the steps that I followed:-
1. I wrote 2 scripts named s1.sh and s2.sh, both trying to add “exec_” prefix to the name of the files present in a folder i which already don't start... (4 Replies)
Discussion started by: piuli
4 Replies
LEARN ABOUT DEBIAN
catalyst::actionrole::needslogin
Catalyst::ActionRole::NeedsLogin(3pm) User Contributed Perl Documentation Catalyst::ActionRole::NeedsLogin(3pm)
NAME
Catalyst::ActionRole::NeedsLogin - checks if a user is logged in and if not redirects him to login page
SYNOPSIS
package MyApp::Controller::NeedsAuth;
use Moose;
use namespace::autoclean;
# One needs to inherit from Catalyst::Controller in order
# to get the Does('NeedsLogin') functionality.
BEGIN { extends 'Catalyst::Controller'; }
sub inbox : Path Does('NeedsLogin') {
# Redirects to /login if not logged in
my ($self, $c) = @_;
$c->stash->{template} = "inbox.tt2";
return;
}
sub inbox : Path Does('NeedsLogin') :LoginRedirectMessage('Your custom Message') {
# Redirects to /login if not logged in-
}
# Turn on in config
MyApp->config('Contoller::Login' => { traits => ['WithRedirect'] });
DESCRIPTION
Provides a ActionRole for forcing the user to login.
WRAPPED METHODS
execute
If there is no logged-in user, call the login_redirect() method in the 'Login' controller with the Catalyst context object, $c, and the
message specified by the ":LoginRedirectMessage('Message here')" method attribute (see the synopsis).
If there is a user logged-in (i.e: "$c->user" is true), execute the body of the action as it is.
SEE ALSO
CatalystX::SimpleLogin::TraitFor::Controller::Login::WithRedirect
CatalystX::SimpleLogin::Controller::Login
CatalystX::SimpleLogin::Form::Login
AUTHORS
See CatalystX::SimpleLogin for authors.
LICENSE
See CatalystX::SimpleLogin for license.
perl v5.14.2 2012-07-15 Catalyst::ActionRole::NeedsLogin(3pm)