The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
shell script for moving all the file from the same folder viv1 Shell Programming and Scripting 1 10-15-2008 04:59 AM
script for Finding files in a folder and copying to another folder satish2712 Shell Programming and Scripting 5 09-11-2008 05:07 PM
Moving Files from one folder to another folder farooqpervaiz Shell Programming and Scripting 10 08-07-2008 03:20 AM
moving a file to a new folder and automated ftp dineshr85 Shell Programming and Scripting 1 10-05-2007 11:24 AM
Suppres error message when moving files from empty source folder Steven Shell Programming and Scripting 2 11-19-2001 01:25 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-26-2008
lalitkumar lalitkumar is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 6
Smile Script for moving files from one folder to other

Hi

I need to move last 1 year old files from one folder to another location on same server.How to write a shell script for the same?


thanx
Lalit
  #2 (permalink)  
Old 11-26-2008
subin_bala subin_bala is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 57
Post

Hi,

Try this

find <source dir name> -mtime +365 | mv *.* <destination directory>

Thnks and Regards,
Subin
  #3 (permalink)  
Old 11-26-2008
lalitkumar lalitkumar is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 6
Thanx for quick response

but how to run this script bcoz i m new in unix evironment.

lalit
  #4 (permalink)  
Old 11-26-2008
subin_bala subin_bala is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 57
#!/bin/sh

find <source dir name> -mtime +365 | mv *.* <destination directory>
  #5 (permalink)  
Old 11-26-2008
shellscripter shellscripter is offline
Registered User
  
 

Join Date: Oct 2008
Location: chennai
Posts: 16
#####################
#!/bin/sh

find <source dir name> -mtime +365 | mv *.* <destination directory>
#########################

save this file as move.sh and try a run... Hope you got


Thanks,
Parkkavan
  #6 (permalink)  
Old 11-28-2008
lalitkumar lalitkumar is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 6
thanx for reply

where I put this file in machine?
  #7 (permalink)  
Old 12-15-2008
lalitkumar lalitkumar is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 6
Hi

I have to added in this script to tell to "Do you want to move the files" with Yes or No option, every time when I run this query.

thanx in advance

Lalit
Closed Thread

Bookmarks

Tags
shell script, shell scripting, unix scripting, unix scripting basics

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:07 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0