01-09-2015
in your script, the user1 is a static user, as the file could be created by anyone, how do I change it to be according to the file owner?
Quote:
Do you mean anyone or anywhere?
anywhere, sorry....
Quote:
If you have no reason to run it as root, never run it as root.
I dont need to run as root, the idea is to use root instead of any other users, just to make easy the process, because it could be anyone to run the touch command, and the file owner could be anyone as well. Besides this, I cannot change the owner.
So, if you will provide me other option, I would appreciate it a lot.
tks.
Last edited by brjohnsmith; 01-09-2015 at 03:33 PM..
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Dear Expert,
Is there a command to do that in Unix?
In such a way that we don't need to actually "write" or
modified the content.
-- monkfan (4 Replies)
Discussion started by: monkfan
4 Replies
2. Shell Programming and Scripting
i want to find the files which are modified in last 30 to 120 minutes
i am using "find . -mmin +30 -mmin -120 "
it is giving me the error
find: bad option -mmin
find: path-list predicate-list
can somebody help me out .
Thank you (5 Replies)
Discussion started by: Prat007
5 Replies
3. Shell Programming and Scripting
Hey guy,
how to make the log.txt file and record date and time when ls, touch and find command run?
Thanks
Boly (13 Replies)
Discussion started by: chenboly
13 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I am reciveing files from a remote system on my linux box. These files are named based on time, which I can use to 'touch' the time .
I can access/modify these files using my id. but when I tried touching time using my id I am getting error;
touch -t 1001261234 1001261234_job2333... (15 Replies)
Discussion started by: rajivbravo
15 Replies
5. UNIX for Advanced & Expert Users
Hello Everyone
I am running a Sunos 5.10 Generic_138888-02 sun4u sparc SUNW,SPARC-Enterprise machine with more than one virtual servers are on this box. My question is possable to change the date and time on the virtual server without change the time on the main server?
Thanks
Peter (4 Replies)
Discussion started by: Peterh
4 Replies
6. Linux
Hi guys,
Hope one of you guys can sort this out for me.
I first noticed this when users were uploading files from our website to our server and the time uploaded was +18 hours ahead of the current time. At first I assumed this was an issue with the coding, but didn't think it was likely as we... (2 Replies)
Discussion started by: markn86
2 Replies
7. Shell Programming and Scripting
Hi,
I wish to change time stamp of a directory with all its subdirectories and files on server.
I am able to find following two ways but want to know which will be the better one. I have not tried anyone of them because I am not sure if it can effect my data:
find * -type d -exec touch... (5 Replies)
Discussion started by: bioinfo
5 Replies
8. UNIX for Advanced & Expert Users
Here is the part of the script: I have modified the file name.:)
SSFILE=${My_HOME_DIR}/log/my_file_ss.log
export MM=`date '+%m'`
export DD=`date '+%d'`
export HH=`date '+%H'`
export MIN=`date '+%M'`
export HOURAGO=`echo ${HH} -1 |bc `
echo $HOURAGO
export TTIME=${MM}${DD}${HOURAGO}00... (5 Replies)
Discussion started by: N1a_Raider
5 Replies
9. SCO
I am using SCO Unix System V/386 Release 3.2v4.2 in some legacy machine.
I find that when I change the date time of the system, it will sometimes restart to the scologin page
It seems to be related to the X11 because other sessions (not scologin session) will not be affected.
Is there... (10 Replies)
Discussion started by: dannychan
10 Replies
LEARN ABOUT DEBIAN
cgi::application::plugin::authentication::driver::generic
CGI
::Application::Plugin::Authentication::Driver::GeneriUsermContributed Perl DocumeCGI::Application::Plugin::Authentication::Driver::Generic(3pm)
NAME
CGI::Application::Plugin::Authentication::Driver::Generic - Generic Authentication driver
VERSION
This document describes CGI::Application::Plugin::Authentication::Driver::Generic version 0.20
SYNOPSIS
use base qw(CGI::Application);
use CGI::Application::Plugin::Authentication;
__PACKAGE__->authen->config(
DRIVER => [ 'Generic', { user1 => '123', user2 => '123' } ],
);
DESCRIPTION
This Driver offers a simple way to provide a user database to the CGI::Application::Plugin::Authentication plugin. It offers three ways to
provide a list of users to the plugin by providing a hash of username/password pairs, an array of arrays containing the username and
password pairs, or a code reference that returns back the username, or undef on success or failure.
EXAMPLE
my %users = (
user1 => '123',
user2 => '123',
);
__PACKAGE__->authen->config(
DRIVER => [ 'Generic', \%users ],
);
- or -
my @users = (
['example.com', 'user1', '123'],
['example.com', 'user2', '123'],
['foobar.com', 'user1', '123'],
);
__PACKAGE__->authen->config(
DRIVER => [ 'Generic', @users ],
CREDENTIALS => [ 'authen_domain', 'authen_username', 'authen_password' ]
);
- or -
sub check_password {
my @credentials = @_;
if ($credentials[0] eq 'test' && $credentials[1] eq 'secret') {
return 'testuser';
}
return;
}
__PACKAGE__->authen->config(
DRIVER => [ 'Generic', &check_password ],
);
METHODS
verify_credentials
This method will test the provided credentials against either the hash ref, array ref or code ref that the driver was configured with.
SEE ALSO
CGI::Application::Plugin::Authentication::Driver, CGI::Application::Plugin::Authentication, perl(1)
LICENCE AND COPYRIGHT
Copyright (c) 2005, SiteSuite. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
DISCLAIMER OF WARRANTY
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT
WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND,
EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
perl v5.12.3 2011-05-16 CGI::Application::Plugin::Authentication::Driver::Generic(3pm)