I would like to have a cron job for my web host to take all files in a given directory and create a sub directory with the folder name as the date of the files in the directory and move all files for that date to this sub folder. Sounds pretty simple but how in the heck do you do this? I have security cameras that FTP images to my webhost. I can quickly have 50,000+ images in the directory. So what I want to do is have a way to store these images by date in its own folder with the date as the name of the folder. I have a few web cams that automatically do this but others do not. Anyone have experience with this and can tell how to setup a webhost to do this task?

  1. Check that your host supports cron jobs.
  2. Create a PHP (or shell) script that does the job.
  3. Add a cron job that will run your file regularly.

Most hosts that support cron, also have support files describing how to set them up. What remains would be writing the script.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.