We help IT Professionals succeed at work.

Automatic movement of files

sumitabh
sumitabh asked
on
Medium Priority
234 Views
Last Modified: 2013-12-04
I am receiving some folders through FTP in my severs's 'MYFolder' everyday.I need to distribute the received folders to 14 users,which has read access 14 different folders(their resepctive ids) in my system.Also there is one Backup folder in my system which will be used for 10 days data retention.
My requirement is
1>.Code should check Backup folder everyday and delete contents older then 10 days.
2>.code should check all 14 user folders for their contents,if it's empty,move todays data evenly to these 14 folders,otherwise first delete the contents from user folders then move todays data.
3>.Move all the todays received folders to Backup folder and remove from MYFolder.

The no. of folders will be more then 14 and I am not limiting my program to check if the same users is getting more workload everyday.
I am looking for full programming code and preferably in either c,ASP(File system object) or Java.
Comment
Watch Question

dbruntonQuid, Me Anxius Sum?  Illegitimi non carborundum.
CERTIFIED EXPERT

Commented:
What's wrong with a batch or script file plus utils?

Author

Commented:
do u have something in that,if yes,I can give it a shot also.

Commented:
Is it a dedicated server? A service can be created which is ran every day. Or you can use SQL Server's scheduler... Is there anything of that that you can use? If so, it should be rather easy...

I just find it pretty "stupid" to put the same file in 14 different directories. Why not one directory and putting a virtual directory to that directory for any of those users?

regards,
CJ

Author

Commented:
I am not looking for any scheduler service,and the need for creating 14 seprate directories is,the access rights to every user will be different and their work performance has to be evaluated according to the work specified to them.If u have some "Sensible" idea,it's welcome.

Commented:
Using Windows NT security you can give specific rights to specific users. So it would still work.

Which FTP service do you use? The one from IIS, or a third party ftp tool? Just wondering. Some ftp tools allow you to add scripts to it, to do things whenever a file is uploaded. You can search the vendor's website for any sdk / scripts etc. Just look around and see if you can do anything with the ftp tool by using scripts or programs. It can help you develop the above mentioned business rules.

regards,
CJ

Author

Commented:
I am coming into picture only when I receive the files of my server,the FTP scenario is being handled by a third party so I have no command over it,I need a solution sitting on my server,be it a script or code.

Commented:
I can make a program which does exactly that, and point you to a direction to automate the thing. If I feel like being creative today I will help you out. I am assuming a windows machine.

Regards,
CJ

Author

Commented:
I would appriciate if ur code can slove my problem.The machine is Windows 2000 Advance Server.

Commented:
I have been working on it for a little while now, and got part of it working. The exact steps that should be taken are a little bit confusing though. Could you please tell me step by step what the program could do? Also a sample of what the program should do would be very nice (user uploads file to folder: Myfolder etc etc).

Also, could you give me your email so that I can send it to you whenever it is finished.

Author

Commented:
The steps will be as follows:

1>. Move all the folders from 'MYFOLDER' to 'BACKUP' folder and empty 'MYFOLDER'.
2>. Distribute Folders from BACKUP to 14 individual folders evenly,in a way that if we have suppose 21 folders first 14 folders are distributed one each to 14 folders and rest 7 goes to first 7 folders.
3>. Check for retention period of 10 days in backup folder and then blow off folders 11 days old.

I have tried this using File System object but couldn't complete it.
U can write me directly on sumitabh2000@hotmail.com.

Commented:
I am a bit confused though. Those steps seem easy enough but once you read them and try to understand, it is a pain.

1) The question talks about files (automatic movement of files), but now I see folders being written down.
2) All folders and files are moved to the backup folder. Then all files and folders are going to be copied to any specified folder. Is that correct?

Especially 2 is pretty much important. The rest is almost read (using the filesystemobject in visual basic).

Regards,
CJ

Author

Commented:
I am sorry for any confusion,but I think it's more becoz of question title.It is the folders I want to move.
First they are to be moved to one backup folder and simultanously to be moved(distributed evenly) to 14 different folders.
I understand this all sounds bit complicated.

Author

Commented:
I am sorry for any confusion,but I think it's more becoz of question title.It is the folders I want
to move.
Firstly all the folders are coming to one folder from where they are to be moved to one backup folder and simultanously to be moved(distributed evenly) to
14 different folders all in the same machine.
I understand this all sounds bit complicated.

Commented:
One last question and then I have all the information I need.

After 10 days then the folders need to be removed from the backup folder. But all those folders are also present in the other directories. Do those need to be removed too?

The program I am creating will allow you to point to the backup folder, add any number of destinations (the 14 folders you mentioned), set an expiry date (in days).

I am not at home right now, but tonight I will finish the thing...

Regards,
CJ

Author

Commented:
I am sorry for not giving u all information required.Yes,Backup needs to be cleared every 11th day and every individual folder(14) to be cleared everyday.
I want to blow off whatever is there in each 14 individual folder,whenever I click my program everyday morning.

Commented:
I've got all the info I need. May I know why you would want to run the program every day? Why not automate it? It's your program though, and it will work this way, I'm just curious :-)
Commented:
Hold on. Each individual folder should be clearewd every day? Is that correct? It's okay by me...one additional option :-)

Author

Commented:
Though It didn't solved my problem but for the effort u put in,I am assigning u the points.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.