Unix Script or command Needed


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Unix Script or command Needed
# 1  
Old 12-08-2011
Unix Script or command Needed

Hi,

I am new to Shell Scripting.
I need to pick the files from one directory and place them in another directory based on time stamp.It should pick the files if the files is not accessed for 1 hour.
Can any one please help me how to work on this.

Thanks in Advance.

Regards,
Prakash
# 2  
Old 12-08-2011
find(1) is your friend. Look at man pages.
You want something like:
Code:
find /path/to/dir -type f -atime +60 -exec mv -t targetDir {} \;

Note that find operates recursively, so it will pick up all files, also those nested deeper in the subdirs. If this is undesired, use
'-maxdepth 1' switch
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Homework & Coursework Questions

Help needed - UNIX command

The 'env' command prints out all of the environment variables and their values. Come up with a command that prints a list of environment variables whose names end with either 'NAME', 'DIR' or 'PATH'. What I've tried. $ env | grep '' Although it highlights the part of the variables... (8 Replies)
Discussion started by: edujs7
8 Replies

2. Shell Programming and Scripting

How to script / command this in UNIX?

Hello Guys, From a given file I have to find out what are all values for "Application States :" and how many of them have same state. eg : If there are possible states in file : Application States : Normal Application States : Terminated Application States : Pending and if there... (11 Replies)
Discussion started by: aixusrsys
11 Replies

3. Shell Programming and Scripting

Needed SFTP script from windows to UNIX server and from UNIX to windows server(reverse SFTP)

hi guys, i need a script to sftp the file from windows to unix server ....(before that i have to check whether the file exists in the windows server or not and again i have to reverse sftp the files from unix to windows server..... regards, Vasa Saikumar. (13 Replies)
Discussion started by: hemanthsaikumar
13 Replies

4. Shell Programming and Scripting

Help needed to create a UNIX Space monitoring script

Hi All, Its urgent.. pls help me out.. I want to create a KSH which should generate a report with the list of users and the files larger than 5 GB created by them in a direcorty and send autogenerated e-mail to them. my input would be users list,directory path and the file size (say 5 GB) ... (11 Replies)
Discussion started by: anman0523
11 Replies

5. Homework & Coursework Questions

Linux/UNIX Bash Shell Script trouble help needed!!

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 2. Shell Bash Script 3. !/bin/bash if echo no directory then mkdir -p /home/AC_Drywall elif ; then echo "$dir already exist" fi (4 Replies)
Discussion started by: TomFord1
4 Replies

6. Shell Programming and Scripting

UNIX script / Command >>> in one line

Hi Experts, Basically I am a SAP programmer. I don't know much about UNIX. But I got a situation, need to use UNIX script /command in my programming. I searched the forum and found the below code. I would like to pass the below UNIX script in my programming code. But my programming will... (1 Reply)
Discussion started by: rbadveli
1 Replies

7. Shell Programming and Scripting

Help Needed in Unix Script

Hi, I have multiple servers and each server hosts multiple databases. Now i have requirement as below 1) Create a file in any server which will hold all the database name. 2) Write a shell script that will read the file and connect to each and every database. and log out of it one by... (2 Replies)
Discussion started by: amritansur
2 Replies

8. HP-UX

Backup Script using fbackup command Help Needed.

Hi Friends, I'm new to unix, I have the below script which takes regular backup. Now if fbackup fails I get the below messages in my log as fbackup(3047): could not open output file /dev/rmt/0m fbackup(3019): would you like to enter a new output file? fbackup(3004): writer aborting... (4 Replies)
Discussion started by: avik.nandi
4 Replies

9. UNIX for Advanced & Expert Users

Help needed with unix script

Hi All, I need to find out the completed transactions count which happened during a particular time duration from a log file. I'm a newbie with scripts and i'm unable to figure out how to get this task done with scripts. I have a transaction log file which has various lines indicating the... (1 Reply)
Discussion started by: haran_3k
1 Replies

10. Shell Programming and Scripting

Script needed to FTP a file from sql report to unix server

Hi All, I have a Sqlplus report which will create a file. I need a FTP Script that will be executed inside the Sqlplus Report to FTP the report output file to unix server. Thanks, Previn (0 Replies)
Discussion started by: vprevin
0 Replies
Login or Register to Ask a Question