I'm trying to write a script that will loop through all files and directories down from a path I give it, and change the permissions and ACL. I was able to do the obvious way and change the files and folders on the same level as teh path...but I need it to continue on deeper into the file... (2 Replies)
I have a folder with many subdirectories and i need to set the modified date to today for everything in it. Please help, thanks!
I tried something i found online, find . -print0 | xargs -r0 touch
but I got the error: xargs: illegal option -- r (5 Replies)
Hi,
I have various log files in different paths. e.g.
a/b/c/d/e/server.log
a/b/c/d/f/server.log
a/b/c/d/g/server.log
a/b/c/h/e/server.log
a/b/c/h/f/server.log
a/b/c/h/g/server.log
a/b/c/i/e/server.log
a/b/c/i/e/server.log
a/b/c/i/e/server.log
and above these have an archive folder... (6 Replies)
I have the below directory in unix environment
/home/bkup/daily: ls -lrt
drwxrwx--x 2 user user 256 Jan 12 18:21 20110112/
drwxrwx--x 2 user user 256 Jan 13 17:06 20110113/
drwxrwx--x 2 user user 256 Jan 14 16:44 20110114/
drwxrwx--x 2 user user ... (2 Replies)
Hello,
Currently I have a painstaking process that I use to move file for a monthly archive. I have to run the same two commands for 24 different directories. I wish to have a script with a for loop automate this and I have not been able to succeed. Here is what I do 24 times. I know this is... (5 Replies)
Can anyone come up with a unix command that lists
all the files, directories and sub-directories in the current directory
except a folder called log.?
Thank you in advance. (7 Replies)
Hello
I have user directories that contain /temp directory.
Example folders:
/user1/temp/
/user2/temp/
/user3/temp/
How can i loop over all user directories and find all files only in their /temp folder?
Thanks a lot for help! (3 Replies)
how can i move "dataName".sql.gz into a folder called 'database' and then move "$fileName".tar.gz * .htaccess into a folder called 'www' with the entire gzipped file being "$fileName".tar.gz? Is this doable or overly complex.
so
mydemo--2015-03-23-1500.tar.gz
> database
-... (5 Replies)
Hello,
I'm a first time poster looking for help in scripting a task in my daily routine. I am new in unix but i am attracted to its use as a mac user.
Bear with me...
I have several files (20) that I manually drag via the mouse into several named directories over a network. I've used rsync... (14 Replies)
Discussion started by: SonnyClark
14 Replies
LEARN ABOUT DEBIAN
mojo
Mojo(3pm) User Contributed Perl Documentation Mojo(3pm)NAME
Mojo - Duct tape for the HTML5 web!
SYNOPSIS
use Mojo::Base 'Mojo';
# All the complexities of CGI, PSGI, HTTP and WebSockets get reduced to a
# single method call!
sub handler {
my ($self, $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;
}
DESCRIPTION
Mojo provides a flexible runtime environment for Perl real-time web frameworks. It provides all the basic tools and helpers needed to write
simple web applications and higher level web frameworks such as Mojolicious.
See Mojolicious for more!
ATTRIBUTES
Mojo implements the following attributes.
"home"
my $home = $app->home;
$app = $app->home(Mojo::Home->new);
The home directory of your application, defaults to a Mojo::Home object which stringifies to the actual path.
# Generate portable path relative to home directory
my $path = $app->home->rel_file('data/important.txt');
"log"
my $log = $app->log;
$app = $app->log(Mojo::Log->new);
The logging layer of your application, defaults to a Mojo::Log object.
# Log debug message
$app->log->debug('It works!');
"ua"
my $ua = $app->ua;
$app = $app->ua(Mojo::UserAgent->new);
A full featured HTTP 1.1 user agent for use in your applications, defaults to a Mojo::UserAgent object. Note that this user agent should
not be used in plugins, since non-blocking requests that are already in progress will interfere with new blocking ones.
# Perform blocking request
my $body = $app->ua->get('mojolicio.us')->res->body;
METHODS
Mojo inherits all methods from Mojo::Base and implements the following new ones.
"new"
my $app = Mojo->new;
Construct a new Mojo application. Will automatically detect your home directory and set up logging to "log/mojo.log" if there's a "log"
directory.
"build_tx"
my $tx = $app->build_tx;
Transaction builder, defaults to building a Mojo::Transaction::HTTP object.
"config"
my $config = $app->config;
my $foo = $app->config('foo');
$app = $app->config({foo => 'bar'});
$app = $app->config(foo => 'bar');
Application configuration.
# Manipulate configuration
$app->config->{foo} = 'bar';
my $foo = $app->config->{foo};
delete $app->config->{foo};
"handler"
$app->handler($tx);
The handler is the main entry point to your application or framework and will be called for each new transaction, which will usually be a
Mojo::Transaction::HTTP or Mojo::Transaction::WebSocket object. Meant to be overloaded in a subclass.
sub handler {
my ($self, $tx) = @_;
...
}
SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>.
perl v5.14.2 2012-09-05 Mojo(3pm)