Hi All,
Im trying to write a script to archive files based on the date the files were created.
For example, if a group of files were created on 23rd August,I would have 230806.tar. I have a problem,I want the script to read a separately created file(readarchive.txt) to look for the path to... (1 Reply)
hi guru,
can advise how to construct a housekeeping script using perl for the following ?
find /var/tmp/logs -name "si*" -type f -exec gzip -f {} \;
find /var/tmp/logs -name "*.gz" -type f -exec mv -f {} /var/tmp/log \;
I found out those are not working in shell at when put them on... (1 Reply)
Hi All
We have a landing directory where source system puts files.There are variable number of files and the file names are also varying.Each files successful transmission is identified by a .done file.If file name is xyz.dat then the confirmation file will be xyz.dat.done.
I want to... (1 Reply)
I'm not sure how to solve the $month-1 thingy or the foreach sentence, so I need some help./*
folders =
folder1
folder2
folder3
folder4
folder5
*/
month=`date +%m`
if($month == 01)
{
prev_month = 12
} else
{
prev_month =... (7 Replies)
Hi all,
I am new to linux and scripting so please forgive me. I need to create a script that will archive files but the max size of the archive need to be 500mb or under. I know about the archiving with parts but i want all the archives as individual archives. Can anyone point me in the correct... (7 Replies)
Hi All,
I have a requirement to archive processed file and retain the archive based on the quantity.. but this is in windows.
I have written a drafted shell script, and would like to have it translated into Batch script.. Please...
Below is the drafted shell script
... (2 Replies)
Hi there can anyone help me to spot my mistake and please explain why it appears
My code :
#!/usr/bin/gawk -f
BEGIN { bytes =0}
{ temp=$(grep "datafeed\.php" | cut -d" " -f8)
bytes += temp}
END { printf "Number of bytes: %d\n", bytes }
when I am running ./q411 an411
an411:
... (6 Replies)
Hello All,
I need immediate help in creating shell script to call archivebkup.ksh script when archive file system capacity reaches threshold value or 60%
Need to identify the unique file system that reaches threshold value.
ex:
capacity
... (4 Replies)
Requirement:
Under fuse application we have placeholders called containers;
Every container has their logs under:
<container1>/data/log/fuse.log
<container1>/data/log/fuse.log.1
<container1>/data/log/fuse.log.XX
<container2>/data/log/fuse.log... (6 Replies)
Discussion started by: Arjun Goswami
6 Replies
LEARN ABOUT PHP
dir
DIR(3) 1 DIR(3)dir - Return an instance of the Directory classSYNOPSIS
Directory dir (string $directory, [resource $context])
DESCRIPTION
A pseudo-object oriented mechanism for reading a directory. The given $directory is opened.
PARAMETERS
o $directory
- Directory to open
o $context
-
Note
Context support was added with PHP 5.0.0. For a description of contexts, refer to "Streams".
RETURN VALUES
Returns an instance of Directory, or NULL with wrong parameters, or FALSE in case of another error.
EXAMPLES
Example #1
dir(3) example
Please note the fashion in which Directory.read(3)'s return value is checked in the example below. We are explicitly testing
whether the return value is identical to (equal to and of the same type as - see Comparison Operators for more information) FALSE
since otherwise, any directory entry whose name evaluates to FALSE will stop the loop.
<?php
$d = dir("/etc/php5");
echo "Handle: " . $d->handle . "
";
echo "Path: " . $d->path . "
";
while (false !== ($entry = $d->read())) {
echo $entry."
";
}
$d->close();
?>
The above example will output something similar to:
Handle: Resource id #2
Path: /etc/php5
apache
cgi
cli
NOTES
Note
The order in which directory entries are returned by the read method is system-dependent.
PHP Documentation Group DIR(3)