Sponsored Content
Full Discussion: Checking directory status
Top Forums Shell Programming and Scripting Checking directory status Post 302569984 by Pramit on Wednesday 2nd of November 2011 07:27:13 AM
Old 11-02-2011
Checking directory status

Can I use -ctime/-mtime to verify if a particular directory has been updated or not?
I don't care about number of days. I just want to perform some operations only if the folder is modified (or it's metadata is modified), i.e. some files are added to the directory.

Moderator's Comments:
Mod Comment This thread has a more informativ character than to answer questions. Open up a normal thread in the appropriate sub forum, thanks - separating this post to a new thread.

Last edited by zaxxon; 11-02-2011 at 09:21 AM.. Reason: user posted in q&a area
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Sending mail, status checking

After I send a mail thr unix with following command uuencode tmpFile | mailx -s "sub1" emailid Yet, I havent received this mail at intended mail client. In order to find out if the sent mail action resulted in failure, I checked at /usr/spool/mail/userid But there also I couldnt find... (1 Reply)
Discussion started by: videsh77
1 Replies

2. Shell Programming and Scripting

Checking Exit Status

I hope one of you smart people out there can help me with what seems like a real simple questing but I can't quite figure out. In a script I am doing a cmp on two files. I am trying to check the exit status with an if statement but can't seem to figure out the syntax. If the exit status is 1 I... (4 Replies)
Discussion started by: PrimeRibAndADew
4 Replies

3. UNIX for Dummies Questions & Answers

checking the status of file ftp

Hi, I m new to unix and I need a help in FTp-ing a file. My script is given below ftp -n <<END_SCRIPT open $FTP_HOST user $FTP_USER $FTP_PASSWD lcd $TEMPFOLDER cd $FTP_LOCATION put $1 bye END_SCRIPT exit_status=$? if ; then log "successfully FTPed the file" else... (5 Replies)
Discussion started by: MeeraNair
5 Replies

4. Shell Programming and Scripting

checking for return status between multiple commands

i have to run set of commands command1 command2 command3 command4 Now Whenever any of these command fails i should quit while capturing error message. Is there a better way then checking for $? after each command. (1 Reply)
Discussion started by: vickylife
1 Replies

5. Shell Programming and Scripting

Checking Status of PID

I'm developing a script that spawns many background processes that will be executing concurrently and need to check the exit status of each spawned process after it terminates. After starting the background process I can get the pid from $! which I can store in an associative array but how do I... (2 Replies)
Discussion started by: twk
2 Replies

6. Shell Programming and Scripting

Checking the status of mail sent.

Hi, Is there any way to check the status of the mail sent or not.e.g mail -s "Error Message" abc@xyz.com <aaa/bbb/data.txt Can it return a status code which will confirm the delivery of mail sent?Please suggest. Thanks, Anil (1 Reply)
Discussion started by: anil029
1 Replies

7. Shell Programming and Scripting

checking the status of sendmail

Hi All, I like to check the status of sendmail and take the appropriate action based on success / failure etc. I have gone through one of the thread where a suggestion is made to use RC for return code Following is the code: ================================== #!/usr/bin/bash export... (0 Replies)
Discussion started by: tmanda
0 Replies

8. Shell Programming and Scripting

Checking status of engines using C-shell

I am relatively new to scripting. I am trying to develop a script that will 1. Source an executable file as an argument to the script that sets up the environment 2. Run a command "stat" that gives the status of 5 Engines running on the system 3. Check the status of the 5 Engines as either... (0 Replies)
Discussion started by: paslas
0 Replies

9. Shell Programming and Scripting

Script for SFTP Status Checking

Greetings... I have to construct shell script to check the SFTP status, Define a global variable (say sftpStatus). Set it to default value "success" when you define it first time outside the script. check the current SFTP status (say currentStatus - local variable within the script) if... (16 Replies)
Discussion started by: manju98458
16 Replies

10. UNIX for Dummies Questions & Answers

FIFO Status Checking/Running

May i please know 1) How to check if FIFO process is down? 2) How to bring FIFO up and running? we are using redhat Linux OS and bash shell Thank you. (1 Reply)
Discussion started by: Ariean
1 Replies
CTIME(3P)						     POSIX Programmer's Manual							 CTIME(3P)

PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the correspond- ing Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. NAME
ctime, ctime_r - convert a time value to a date and time string SYNOPSIS
#include <time.h> char *ctime(const time_t *clock); char *ctime_r(const time_t *clock, char *buf); DESCRIPTION
For ctime(): The functionality described on this reference page is aligned with the ISO C standard. Any conflict between the requirements described here and the ISO C standard is unintentional. This volume of IEEE Std 1003.1-2001 defers to the ISO C standard. The ctime() function shall convert the time pointed to by clock, representing time in seconds since the Epoch, to local time in the form of a string. It shall be equivalent to: asctime(localtime(clock)) The asctime(), ctime(), gmtime(), and localtime() functions shall return values in one of two static objects: a broken-down time structure and an array of char. Execution of any of the functions may overwrite the information returned in either of these objects by any of the other functions. The ctime() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe. The ctime_r() function shall convert the calendar time pointed to by clock to local time in exactly the same form as ctime() and put the string into the array pointed to by buf (which shall be at least 26 bytes in size) and return buf. Unlike ctime(), the thread-safe version ctime_r() is not required to set tzname. RETURN VALUE
The ctime() function shall return the pointer returned by asctime() with that broken-down time as an argument. Upon successful completion, ctime_r() shall return a pointer to the string pointed to by buf. When an error is encountered, a null pointer shall be returned. ERRORS
No errors are defined. The following sections are informative. EXAMPLES
None. APPLICATION USAGE
Values for the broken-down time structure can be obtained by calling gmtime() or localtime(). The ctime() function is included for compati- bility with older implementations, and does not support localized date and time formats. Applications should use the strftime() function to achieve maximum portability. The ctime_r() function is thread-safe and shall return values in a user-supplied buffer instead of possibly using a static data area that may be overwritten by each call. RATIONALE
None. FUTURE DIRECTIONS
None. SEE ALSO
asctime(), clock(), difftime(), gmtime(), localtime(), mktime(), strftime(), strptime(), time(), utime(), the Base Definitions volume of IEEE Std 1003.1-2001, <time.h> COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technol- ogy -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . IEEE
/The Open Group 2003 CTIME(3P)
All times are GMT -4. The time now is 06:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy