Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
DOS/Other
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory modem monitor motherboard network printer problem ram registry router security slow software sound toshiba trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > DOS/Other >
how to take backup and delete OLD files

Reply  
Thread Tools
qutesanju's Avatar
Junior Member with 8 posts.
 
Join Date: May 2009
08-Jan-2010, 09:06 AM #1
how to take backup and delete OLD files
hi experts,
I need to take a backup and delete old files present on c:\testfolder ,older than 1 month or 6 month than current date ,at the same time I need to ZIP all those files also ,how can I achieve this?
e.g my files are like this
c:\testfolder\Action_2009-11-23_12916.csv
c:\testfolder\Waste_2009-11-23_13540.csv
...............
etc
I have to put all those files into
c:\testfolder\Archive\6monthsBackup.zip

Pls help, me

Thanks guys.
Squashman's Avatar
Trusted Advisor with 18,706 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: Bocks of Rox
08-Jan-2010, 09:48 AM #2
I am confused by the older than 1 month or 6 months statement.

Do you want to archive the files to a zip file based on the created date or last modified date?

What zip program do you have on your computer now?
TheOutcaste's Avatar
Computer Specs
Distinguished Member with 9,048 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
08-Jan-2010, 10:16 AM #3
I should type faster
I have the same questions as Squashman.

I'm assuming you want to use the date that is part of the file name, rather than the file system created/modified date.
If you Zip and delete files older than 1 Month, there won't be any files older than 6 months, so I'm not sure what you would be putting into a 6 month backup.

I'd assume this is something done once a month? If done daily, your 1 month archive would only contain files for one day. And what about backups for files less than one month old?
Is what you want more like this:
Backup files daily.
Then, each month:
Zip files from previous month into a zip archive and delete the archived files from the testfolder and the backup folder. So Feb 1, you would archive all Jan files
OR
Zip files older than one month into a zip archive and delete the archived files from the testfolder and the backup folder. So Feb 1, you would archive all Dec files.

Or do you always want to have just the last 30 days in testfolder, then archive the backup folder using one of the above options?

Also:
What OS will this be running under?
What Zip porgram are you going to be using?
Will you be using command line switches for the GUI version, or using a command line version of the Zip program, if it has one?
Will the backup location be another hard drive on the same PC, a shared folder on another PC, or online storage of some kind?
(A folder on the same hard drive is not a good choice for a backup location)
Will the backup location be a removable device, like an external drive, USB Flash drive, or Memory card that might not always be connected?

Also, will the date in the file name always be a two digit day and month, i.e., include a leading 0?
__________________
Microsoft MVP - Windows Expert - Consumer
Of course I know all the answers ; I just don't always match the answers to the right questions


Last edited by TheOutcaste; 08-Jan-2010 at 10:21 AM..
scrfix's Avatar
Computer Specs
Member with 337 posts.
 
Join Date: May 2009
Experience: Computer Repair Expert
10-Jan-2010, 01:20 AM #4
Guys,

I agree that he could have been much more clear on the subject however being somewhat of an expert of not providing all the information to squashman time and time again (lol) I believe what he meant to say was either NOT the word OR but up to

OR

More feasible. He would like to do:
1. A daily backup or nightly in this case and backup and archive into a zip file any files that are over a month old up to 6 months old.

2. Anything older than 6 months can be deleted from the archive so the zip file does not become enormous over time.

If this is indeed the case it would involve not only looking at the folder for the date however also looking at the compressed folder.

Just my two cents because I am about to post a different question among the same lines but mine is much much easier. I will post mine in a new thread.
__________________
Wayne Leiser, Spectacular Computer Repair Computer Repair, Computer Services
World Famous Gift Baskets: Gift Baskets
Resources LLC: Water Treatment Coagulation, Water Recycling
qutesanju's Avatar
Junior Member with 8 posts.
 
Join Date: May 2009
12-Jan-2010, 01:14 AM #5
I want to take backup of 6 month and ZIP all those files,provided it should take date from file name Waste_2009-11-23_13540.csv
I'm using windows OS and pentazip is the software utility I'm using
scrfix's Avatar
Computer Specs
Member with 337 posts.
 
Join Date: May 2009
Experience: Computer Repair Expert
12-Jan-2010, 09:48 AM #6
Okay,

There seems to be a communication issue here because you are not providing us with enough information to help you out. Let me attempt to be more specific.

Quote:
Originally Posted by qutesanju View Post
I want to take backup of 6 month and ZIP all those files
1. Do you want the backup to run daily? If so, this will end up with tons of zip files with only 1 day in it? Are you running it every 6 months to store that last 6 months worth of data? If this is it, this is not very efficient. Being very specific, let us know step by step.

Example:
I would like to have the backup run (daily, weekly, monthly, semi-annually, etc etc etc). There is 1 file from one computer in C:/testfolder every day. OR There are 15 files from 15 computers saved in C:/testfolder every day.

Step 1: I want for the backup program to read the file name and look at the date in the file name. The date will always be formatted in (2009-01-02, 2009-1-2, etc etc) OR The date will change from time to time. It could be (09-01-02, 09-1-2, etc etc)

Step 2: I would then like for it to take the file name and based upon that look for any files that are older than 6 months.

Step 3: So on and so on. The more specific the easier it is to help you.

Quote:
Originally Posted by qutesanju View Post
provided it should take date from file name Waste_2009-11-23_13540.csv
2. We have established that you want to utilize the date in the name. Will the date in the name ALWAYS be in that format? Will the date be 2009-01-02 OR will the date be 2009-1-2 OR 09-01-02 OR 09-1-2 (I think you get my point).

Quote:
Originally Posted by qutesanju View Post
I'm using windows OS
3. What Windows Version? XP Home, XP Pro, Vista Home Basic, Vista Home Premium, Vista Business, Win 7, Server 2003, Server 2003 small business, etc etc etc etc. You can find this information out by holding down the Windows Key on your keyboard and pushing the R key one time and letting up. This will bring up the Run dialogue box. Type in winver and push enter on your keyboard. (Windows Key is the key with the Microsoft Logo on it usually found in the lower left of the keyboard if you are on a desktop computer and can be in the upper right on a laptop computer) (Windows Key+R).

Quote:
Originally Posted by qutesanju View Post
pentazip is the software utility I'm using
4. Do you know anything about Pentazip? Does it have command line parameters? If you don't know this answer, this is okay. However TheOutCaste was asking if you wanted to use command line switches for the Graphic User Interface or if you didn't care about that and wanted to use the command line version, if Pentazip even has one. Does it matter what program your using as long as it gets zipped. If not, then I believe we can utilize the one that comes with Windows based upon which version of Windows OS you are running asked above.

5. Where do you want the files backed up to?
(A folder on the same hard drive is NOT a good choice for a backup location)
Will it be an external drive?
Will this be a shared folder over a network, online storage?
Will this be a Flash or Thumb Drive or Memory Card?
__________________
Wayne Leiser, Spectacular Computer Repair Computer Repair, Computer Services
World Famous Gift Baskets: Gift Baskets
Resources LLC: Water Treatment Coagulation, Water Recycling
qutesanju's Avatar
Junior Member with 8 posts.
 
Join Date: May 2009
18-Jan-2010, 03:02 AM #7
Please find the answers as below
1. I don’t want to run backup daily ,instead I wil be running ot for yearly mode or 6 months mode .initially pls help me in running yearly mode.

Step1
Date will always remain same 2009-01-02

So
There are 15 files from C:/testfolder saved in C:/backupfolder every year.


Yes I want to utilize the date in the name

I will be using windows server 2003 edition.

I’m not sure about pentazip. I wanted to use command line switches only

Path for my backup folder will be c:\testfolder as input path and c:\testfolder\backup will be my backed up path
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 12:08 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.