I have custom content types created using CCK. These content types have "file" fields to upload files. I had more than 3000 files in the different content types. I ran cron to index my files by running cron.php in my browser. I did not check if any problem occurred. After 2-3 days, when checking for the files, I realized that the number of files in the content folder had come down to 400 something. At the same time, the filepaths in the database were also blank for most of the content. I don't know how the problem was caused, but I had not done anything else during that period that could have deleted the files. So, I am wondering if cron deleted the files. I have tried to understand what cron exactly does, but have not been able to.

Now I need to run cron to index my files, but I am afraid that my files may get deleted again.

Any help will be highly appreciated.

Comments

redijedi’s picture

Assigned: Unassigned » redijedi
Status: Active » Closed (won't fix)

I don't think this applies to the Cron All project. This project simply runs cron on any sub-site in a multisite configuration.

Tapa’s picture

I found out that cron deletes files that have 'status' set to '0' in the files table. A '0' status indicates 'temporary' file and is thus deleted. The 'status' should be set to '1' to mark them as permanent. The file upload module / CCk filefield will handle this automatically. But I had created the files using a data migration script that I had written, and had mistakenly set status to '0'.

dsobon’s picture

Status: Closed (won't fix) » Needs review

This problem happens with fontyourface/modules/local_fonts/local_fonts.module

Put simply, if it uses the function file_save_upload(...), it specifically sets the status flag to FILE_STATUS_TEMPORARY (pressflow) or 0 (drupal) regardless of failure or success. the status flag is stored in the db when file_save(...) is called by file_save_upload(...).

sreynen’s picture

Status: Needs review » Closed (won't fix)

The problem with fontyourface seems to be a bug in fontyourface, not an issue with Cron All.

wylbur’s picture

I'm having the same issues with local fonts. No time to report more details today, but can test solutions in the coming weeks.