Re: [TwinCLinG] query regading backup
- ----- Original Message ----
From: PAL VISHAL <palvishal@...>
To: Linux Group Hyderabad <email@example.com>
Sent: Thursday, 17 May, 2007 9:23:57 PM
Subject: [TwinCLinG] query regading backup
I have a query, actually at my office server (RHEL 4) there are 3 different folder for e.g
(each with inside more than 20 folder, Sub folder & several files )
The folder name is depend on there department & people from respective group were working on that folder from last 1 year. All I want is to keep latest six month file on hard drive (Due to space problem) and move the six month old files to other hard drive .
Is there any command which will search all files from all folder & sub folder backup it to the other hard drive and at last delete it. The backup should follow the same folder structure as the orignial one to store the backed up files.
----- Reply Message ----
one good option to write a script for this to do the following
1. Find all the files older than 6 months (man find for correct options) , store the list into another file
2. cat the list of files and tar them (tar can to preserve the directory structure and permissions, check man pages)
3. move the tar to another location
4. cat the list and then delete the files
use the man pages for exact commands and options
WARNING : Test the script before you run it on the actual files or you are at risk losing the files!
Yahoo! India Answers: Share what you know. Learn something new
[Non-text portions of this message have been removed]