1.

Solve : Batch to move files by date?

Answer»

Hi. I need some help as I don't understand how this could be done.

I want to create a batch file that I would move into my startup directory and would execute each time I log on. I am using windows 7.

I have a video collection that is ever expanding and I want to organize the collection by date create a backup on a seperate drive. Basically it is set up like this:

1. A video gets downloaded and placed into F:\Videos
2. I need it to remain in this folder for 3 months after it was downloaded or I guess I would say MODIFIED.
3. After 3 Months from the last time it was modified to the current date set the computer it would place the video in the folder F:\Videos\3+Months
4. After it finishes that loop and moves the applicable videos over I want it to check F:\Videos\3Months for any videos older than a year from the current date.
5. If it finds videos over a year since they where last modified it would move them to F:\Videos\1+Years

6. Then, with possibly a seperate batch file, I need it to copy and make the same changes to a backup drive, I:\, with the same folder structures. However not just the videos but the whole F:\ drive with all its other files included. The problem I have with this is that if a video or any other file gets moved into another directory in F:\ it will cause two of the same files on I:\. How would it be possible to mirror the drive without copying all the data over again each time?Only method I can think of is very inefficient and large in routine size. Basically EVERYTIME the startup batch is triggered it passes a current days contents into the next day, making the current day folder clean, BUT you would have to have it execute in a manner from oldest to newest to shuffle everything down without passing yesterdays content into 2 days ago folder and merging content.

You would have 30 folders for your files downloaded within the last 30 days, then 90 folders for the last 90 days, and then a greater than 90 days folder that would be the final pool of all old files. The data from folder_30 would be passed into the Folder_31 which can be a sub-folder under 90_Days and continue on its shuffle every day until it makes its way to a final dump location in which you can seal the contents into folders with dated folder names to avoid overwriting of same filenames.

Biggest problem would be that it would TAKE a long time to execute the more files you have and the larger the size. I have used a similar system for a 7-day rolling backup where on the 8th day, the information overwrites the 1st days folder contents. Never made anything this large dealing with many large files to know how slow it will run.

To keep newer worked on projects seperate from older projects to solve the need for keeping newer altered or modified projects towards the front of this large shuffle, you simply copy say Folder_2's content to Folder_1 and so you have the original old file in Folder_2 and now you have the revised copy in Folder_1. Now tomorrow or next time you logon and the startup triggers your batch it will shuffle all files 1 folder down the line in reverse order to avoid merging projects.

Moving this much content is going to give your hard drive quite a workout, so you will definately want to run daily backups to say an external drive in case you work it to its death shuffling great amounts of data daily. Hard Drives are pretty rugged, but they can wear out under EXTREME conditions!



Discussion

No Comment Found