06-14-2005
Need help in sftp basic commands
I'm trying to make use of some common generic functions already present in the scripts loaded in the environment.
A variable VAR1 is declared and used in the generic functions.
Its value is also set in the generic function.
Now I need to use that generic function for PURGING of some old files matching a pattern which are older than x days.
The suggested syntax is
find.. -name LDS-* -mtime +${VAR1} \
-exec ls -l {} \; >> ${LOG_PURGEFILE} 2>&1
But
1. find command does not work in sftp environment.
2. I need to declare VAR1=x, but I cant set the variables in a sftp session.
CUZ Setting variables in an sftp session in not possible. They can only be set outside the sftp and referenced in it
So pls advise how do I go about it..
Pls help ASAP..
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I need a sheet with the basic unix commands , and commands for VI editor. Does anyone know where i can get them. (3 Replies)
Discussion started by: Peter Spellman
3 Replies
2. UNIX for Dummies Questions & Answers
I'm training a newbie on unix. He's in another site and I can't share my unix books with him - is there any documentation on basic unix commands he can download? (1 Reply)
Discussion started by: kdgorton
1 Replies
3. Windows & DOS: Issues & Discussions
Hi.
I'm New user for this Forum.Presently i'm working with Cygwin
I want to know the basic commands that will be used for Cygwin.
Can anyone guide me on this regards
Thanks & Regards
Sanjay (0 Replies)
Discussion started by: sanjay.karthik
0 Replies
4. UNIX for Dummies Questions & Answers
I'm trying to find out what all is involved with setting up SFTP?
1) Do Solaris machines come with a SFTP server and client already installed.
2) If so would I have to install SFTP clients on windows, if I want to transfer files to a Solaris box?
3) If SFTP doesn't come prepackaged would I... (1 Reply)
Discussion started by: JohnRodey
1 Replies
5. UNIX for Dummies Questions & Answers
Why do basic unix commands such as "ls" not work in "BASH" mode??
I am frustrated!! (10 Replies)
Discussion started by: PixelLover
10 Replies
6. UNIX for Dummies Questions & Answers
I would be thankful if anyone could show me commands to do the following tasks in vi:1) How can I undo or redo my last action in vi editor.
2) How can I copy only a word or a portion of line (not the whole line) in vi, like
we can select text and press ctrl+c in notepad to copy any text.
3)... (4 Replies)
Discussion started by: nervous
4 Replies
7. Red Hat
Hello out there!!!
I have a Red Hat Entreprise Linux 4 server and I am encountering this error
# grep
Segmentation Fault
I know it is not the right use of grep command, but I did that just for testing purpose,then I did
# which grep
/bin/grep
# ls -l /bin/grep
-rwxr-xr-x 1 root... (4 Replies)
Discussion started by: inhaki
4 Replies
8. Solaris
I want the commands list to view only files, and only directories and all the basic commands for a beginner of solaris (1 Reply)
Discussion started by: omsingh2k5
1 Replies
9. Android
Hi,
I have a n android phone and just rooted it. I access it using 'terminal Emulator'. I performed many basic linux-like commands in the terminal like rm,ls,df,reboot etc and they are working fine. But many of them are not like man <something>, clear,du etc.
Can any of you please help to... (20 Replies)
Discussion started by: shekhar_4_u
20 Replies
LEARN ABOUT PHP
ssh2_sftp_lstat
SSH2_SFTP_LSTAT(3) 1 SSH2_SFTP_LSTAT(3)
ssh2_sftp_lstat - Stat a symbolic link
SYNOPSIS
array ssh2_sftp_lstat (resource $sftp, string $path)
DESCRIPTION
Stats a symbolic link on the remote filesystem without following the link.
This function is similar to using the lstat(3) function with the ssh2.sftp:// wrapper in PHP 5 and returns the same values.
PARAMETERS
o $sftp
-
o $path
- Path to the remote symbolic link.
RETURN VALUES
See the documentation for stat(3) for details on the values which may be returned.
EXAMPLES
Example #1
Stating a symbolic link via SFTP
<?php
$connection = ssh2_connect('shell.example.com', 22);
ssh2_auth_password($connection, 'username', 'password');
$sftp = ssh2_sftp($connection);
$statinfo = ssh2_sftp_lstat($sftp, '/path/to/symlink');
$filesize = $statinfo['size'];
$group = $statinfo['gid'];
$owner = $statinfo['uid'];
$atime = $statinfo['atime'];
$mtime = $statinfo['mtime'];
$mode = $statinfo['mode'];
?>
SEE ALSO
ssh2_sftp_stat(3), lstat(3), stat(3).
PHP Documentation Group SSH2_SFTP_LSTAT(3)