[OT] Re: Scp files to another server help
From: Mike Hunter (mhunter_at_uclink.berkeley.edu)
Date: 12/13/03
- Next message: Jürgen Exner: "Re: A way to grab string from another program in perl?"
- Previous message: Ben Morrow: "Re: @ISA specific to instance rather than class?"
- In reply to: JoelAshton: "Re: Scp files to another server help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 13 Dec 2003 00:59:44 +0000 (UTC)
On 12 Dec 2003 13:41:46 -0800, JoelAshton wrote:
> "Tintin" <me@privacy.net> wrote in message news:<br68g0$28enps$1@ID-172104.news.uni-berlin.de>...
> > "JennAshton" <> wrote in message
> > news:c5b9b407.0312081805.19193fd1@posting.google.com...
> > > Hi,
> > >
> > > I wrote a simple scp script from my server to pacman server which
> > > copies all jpg files to /jennash/ directory.
> > >
> > > Now, I need help with this script. I would like it to pull not just
> > > *.jpg files but other file types as well. Also, is it possible to pull
> > > only files that is 3 minutes old? Please help.
> > >
> > > Thanks!
> > >
> > > JennAsh
> > >
> > > #!/usr/bin/perl
> > >
> > > system('scp /export/www/docs/*.jpg pacman:/export/www/jennash/');
> > >
> > > exit;
> >
> > And the relevance to Perl is???
> >
> > Here's a shell script to do it:
> >
> > #!/bin/sh
> > scp `find /export/www/docs -type f -mmin 3` pacman:/export/www/jennash
>
>
> Well, seeing your shell script I was able to come up with this
> rsync -rt -e /usr/local/bin/ssh /htodcs/www/my_folder/
> pacman:/htdocs/www/remote_folder
>
> The above script allows me to execute via command line in Unix.
> However, when I saved the script has shell script and tried to
> executed via browser it didn't work.
>
> The page displays:
>
> We trust you have received the usual lecture from the local System
> Administrator. It usually boils down to these two things: #1) Respect
> the privacy of others. #2) Think before you type. Password:
>
>
> Not sure why it is displaying since the sys-admin open up ssh
> connection and a key has been established in my local directory in the
> remote server.
>
> Can anyone advise?
If you run it as a CGI, you'll be running it as a different user. I don't
know how your web server is set up, so I can't tell you how to fix it, but
you somehow need to get the script to run as the appropriate user, perhaps
using the "setuid" bit for the executable permission.
Mike
- Next message: Jürgen Exner: "Re: A way to grab string from another program in perl?"
- Previous message: Ben Morrow: "Re: @ISA specific to instance rather than class?"
- In reply to: JoelAshton: "Re: Scp files to another server help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|