Hi all,
I wrote this script to find files older than time parameter, count the number of files, and send an email to me that some files are in a particular folder. For the particular path, the script should wait delay parameter before running again.
For example, assuming the input file looks... (4 Replies)
Hi
When trying to find and delete files which are, say, 1 day, the find command misses a day. Please refer the following example.
xxxd$ find . -type f -ctime +1 -exec ls -ltr {} \;
total 64
-rw-rw-r-- 1 oracle xxxd 81 Apr 30 11:25 ./ful_cfg_tmp_20080429_7.dat
-rw-rw-r-- 1... (4 Replies)
Hello All,
I need to write a script/command which can find out the number of .csv files residing in a directory older than 1 day. The output should come with
datewise (means for each date how many files are there).
I've this command, but this command gives the total number of files. It's... (10 Replies)
Hi Gurus
the count of files in a particular Directory...
ls -lrth | grep -c ^-
can any one share the command to Count the files which is Older than 3 months
So please help me out in this
Thanks in Advance (2 Replies)
I need to archive the older than 30 day file to another uinx server.I have wrote the below uinx script.
for LOOK_DIR in /TempFiles
do
for FILE in `find ${LOOK_DIR} -mtime -30 -exec ls {} \;`
do
echo ${FILE} >> file_list ## This file will have the list of files copied and... (12 Replies)
// AIX 6.1
I need to extract PIDs of
ps -ef |grep /usr/lib/lpd/pio | awk '{print $2}'
ps -ef |grep qdaemon |grep /usr/bin/ksh | awk '{print $2}'
that are older than 1 day.
I know find . -type f -mtime +1, but it doesn't work for PIDs.
Please let me know how to get the PIDs older than... (1 Reply)
I thought that this would work for grep'ing files older than 1 day.
ps -o etime,pid,user,args -e|awk '/^+-/'|sort -t- -n -k 1,1 |grep qdaemon |grep /usr/bin/ksh
But, it is not grep'ing any of files (i.e. below) older than 1 day.
d_prod 33757970 61999560 0 Oct 27 - 0:00... (8 Replies)
Dear Ladies & Gents,
I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out:
for filename in $(find /var/log/test... (2 Replies)
As one of our requirement was to connect to remote Linux server through SFTP connection and delete some files which are older than 7 days.
I used the below piece of code for that,
SFTP_CONNECTION=`sftp user_id@host ...
cd DESIRED_DIR;
find /path/to/files* -mtime +5 -exec rm -rf {} \;... (1 Reply)
As one of our requirement was to connect to remote Linux server through SFTP connection and delete some files which are older than 7 days.
I used the below piece of code for that,
SFTP_CONNECTION=`sftp user_id@host ...
cd DESIRED_DIR;
find /path/to/files* -mtime +5 -exec rm -rf {} \;
bye... (2 Replies)
Discussion started by: ATWC
2 Replies
LEARN ABOUT PHP
ssh2_sftp_stat
SSH2_SFTP_STAT(3) 1 SSH2_SFTP_STAT(3)ssh2_sftp_stat - Stat a file on a remote filesystemSYNOPSIS
array ssh2_sftp_stat (resource $sftp, string $path)
DESCRIPTION
Stats a file on the remote filesystem following any symbolic links.
This function is similar to using the stat(3) function with the ssh2.sftp:// wrapper in PHP 5 and returns the same values.
PARAMETERS
o $sftp
- An SSH2 SFTP resource opened by ssh2_sftp(3).
o $path
-
RETURN VALUES
See the documentation for stat(3) for details on the values which may be returned.
EXAMPLES
Example #1
Stating a file via SFTP
<?php
$connection = ssh2_connect('shell.example.com', 22);
ssh2_auth_password($connection, 'username', 'password');
$sftp = ssh2_sftp($connection);
$statinfo = ssh2_sftp_stat($sftp, '/path/to/file');
$filesize = $statinfo['size'];
$group = $statinfo['gid'];
$owner = $statinfo['uid'];
$atime = $statinfo['atime'];
$mtime = $statinfo['mtime'];
$mode = $statinfo['mode'];
?>
SEE ALSO ssh2_sftp_lstat(3), lstat(3), stat(3).
PHP Documentation Group SSH2_SFTP_STAT(3)