Skip to content

Instantly share code, notes, and snippets.

View captainbenno's full-sized avatar

Ben Dry captainbenno

  • Adelaide
View GitHub Profile
@captainbenno
captainbenno / index.php
Last active February 4, 2018 23:07
A quick script to move photos (or any sort of files) into a new folder structure consisting of dates based on the modified date of the file.. eg: /photos/2018/09/21/somephoto.jpg
<?php
// Author: Benjamin Dry
// Date: 5th Feb 2018
// Script to sort photos and movies (or any file ext really) into folders based on the dates they were created.
// run from the command line:
// php index.php
// note: ensure both the origin and destination folders have the correct permissions.
// tested on Ubuntu only, also has some array building stuff in it used for debugging etc but could be largely ignored...
$origin_folder = "/media/ben/mac/mac_data";