I want to find the size of particular file exists in a particular directory
and i wnt to zip it.
In the below mentioned code it should check the MQ.log in the
particular directory.Please correct my code so that it will check
for particular MQ.log but i could not able to check whether
the... (9 Replies)
We have data files that are ftp'd every morning to a SUN server. The file names are exactly the same except for that each has the date included in its name. I have to write script to do 2 things:
STEP 1) Verify that the file arrived in morning.
STEP 2) Compare the file size of the current... (3 Replies)
I am trying to write a script to backup my laptop to a NAS drive using rsync. I want the backup to be done, only if it has been more than a week since my last backup.
Each time the rsync command executes, I also create a file backuptime.txt file, with the time at which the script completed the... (1 Reply)
Hi All,
working on AIX 5.3.
Requirement is:
Shell script in ksh to check if any file exists in 4 folders as below:
1. /FILE/INB/INT1
2. /FILE/INB/INT2
3. /FILE/INB/INT3
4. /FILE/INB/INT4
Thanks a lot for your time!
a1_win. (3 Replies)
Hi,
I am trying to check the existence of a file, from a list of possible filenames:
status-A
status-B
status-C
before retrieving the last modified datetime using ls, I want to check it exists or ls will throw an error.
So I have tried this:
if ; then
ls status-*
fi
But the if... (3 Replies)
guys,
I am trying to write a script that does the following:
it looks for a file in a specific directory and if the file is not there (NOT), it emails me. I have tried the following but its not working. It simply hangs up. Please help.
if
then
mail -s 'blah blah blah' my email... (4 Replies)
Hi Forum.
I have a script that accepts 3 input parameters (source directory, list file text, sleep time) and checks for the presence of files. If not there, script goes to sleep for certain amount of time provided by 3rd input.
list file text contains 1 entry but may contain more (file... (13 Replies)
Hi,
I am trying to write a script which checks if any file exists with "*.log" or "*.out" in Directory
below is the code
#------------------
path=/abd/xyz/
if ; then
echo "Good"
else
echo "Failure"
fi
#--------------------------
its always going to else part and printing... (8 Replies)
Dear members, The following expect script connects to remote node and check for the file "authorized_keys" in directory /root/.ssh in remote node. However the result is always found even if the file exist or doesn't exist.
expect {
"$fname" {
send_user "found\n"
}
Any idea what is... (4 Replies)
Hi All,
I am a beginner in this and trying to write a shell script in linux which will :
1. Ask for a file name and check if its exists.
2. If file exists only then it will ask for the new target folder, after entering target folder name it will check if it exists.
3. If target folder... (3 Replies)
Discussion started by: ashish_neekhra
3 Replies
LEARN ABOUT PHP
datetime.add
DATETIME.ADD(3) 1 DATETIME.ADD(3)DateTime::add - Adds an amount of days, months, years, hours, minutes and seconds to a DateTime object
Object oriented style
SYNOPSIS
public DateTime DateTime::add (DateInterval $interval)
DESCRIPTION
Procedural style
DateTime date_add (DateTime $object, DateInterval $interval)
Adds the specified DateInterval object to the specified DateTime object.
PARAMETERS
o $object
-Procedural style only: A DateTime object returned by date_create(3). The function modifies this object.
o $interval
- A DateInterval object
RETURN VALUES
Returns the DateTime object for method chaining or FALSE on failure.
EXAMPLES
Example #1
DateTime.add(3) example
Object oriented style
<?php
$date = new DateTime('2000-01-01');
$date->add(new DateInterval('P10D'));
echo $date->format('Y-m-d') . "
";
?>
Procedural style
<?php
$date = date_create('2000-01-01');
date_add($date, date_interval_create_from_date_string('10 days'));
echo date_format($date, 'Y-m-d');
?>
The above examples will output:
2000-01-11
Example #2
Further DateTime.add(3) examples
<?php
$date = new DateTime('2000-01-01');
$date->add(new DateInterval('PT10H30S'));
echo $date->format('Y-m-d H:i:s') . "
";
$date = new DateTime('2000-01-01');
$date->add(new DateInterval('P7Y5M4DT4H3M2S'));
echo $date->format('Y-m-d H:i:s') . "
";
?>
The above example will output:
2000-01-01 10:00:30
2007-06-05 04:03:02
Example #3
Beware when adding months
<?php
$date = new DateTime('2000-12-31');
$interval = new DateInterval('P1M');
$date->add($interval);
echo $date->format('Y-m-d') . "
";
$date->add($interval);
echo $date->format('Y-m-d') . "
";
?>
The above example will output:
2001-01-31
2001-03-03
NOTES DateTime.modify(3) is an alternative when using PHP 5.2.
SEE ALSO DateTime.sub(3), DateTime.diff(3), DateTime.modify(3).
PHP Documentation Group DATETIME.ADD(3)