525362 File Clean-up

I need a script written to do the following.

This site allows the uploading of photos by its members. For some reason, either permission or programming errors, the photos are not removed when the member deletes the photo or when the members account is deleted. Because of that I have a mess.

Currently in the directory I have 55,000+ photos, only about 25,000 are active on the site.

The script will run from the command line . PHP, Perl, or sh is fine with me.

Script will need to log the files it removes, a text file is fine.

Script will need to remove the file from the Pictures directory and a file with the same name from the thumbnails directory

Filename Examples

[url removed, login to view]

[url removed, login to view]

[url removed, login to view]

[url removed, login to view]

[url removed, login to view]

Each file has two data items in the name. The number before the dash is the member ID of the person that uploaded the file. The number after the dash is the ID of the photo. In our Mysql database we have a members table with the member ID and a pictures table with the photo ID.

My thought is that we need to check each file to see if the member exists in the member table, if not remove the file and the thumbnail. Next we need to see if the photo exists in the pictures table, if not remove it, and the thumbnail. There must be a good way to go about this while not killing Mysql or the server. After the initial cleanup I plan to run this on a weekly or monthly basis to keep things clean.

Beceriler: Her şey Kabul, MySQL, Perl, PHP

Daha fazlasını gör: programming errors, perl programming examples, sh, data clean-up, clean photos, clean my, clean files, check permission file, check server log errors, php file remove, php remove file, cleanup data mysql, check table mysql script, mysql remove table, php mysql photo uploading, active directory perl, command line written, mysql clean, perl check directory, mysql clean data, clean text, uploading file, mysql script check table, thumbnails programming, script must run command line

İşveren Hakkında:
( 11 değerlendirme )

Proje NO: #2271302



Can I do it in bash? I can also do it in PHP. Rockin it since 1997

1 gün içinde %selectedBids___i_sum_sub_4%%project_currencyDetails_sign_sub_5% USD
(0 Değerlendirme)