In this post I will show you how to convert dropbox links to work in the same way that public folder links worked before they where banished.
I use this for dropbox based images for my vagrant files. However it will work for embedded links in html files. Here is a video I made where I do the same thing but for vagrant box files.
Step 1: Get your link
Step 2: convert your link
As you can see we break the links into 3 parts. The content provider service, the random characters you get allocated by dropbox and finally the file name.
Want a script to delete files that are older than a certain date? Lets say more then 30 days old.
Your mind first races to the created date stamp. Well you may need to think that over in some situations!
Lets take a look at some date stamps in Windows. Then I’ll explain.
This file was last modified over a month before it was created !!!!
No its not photoshop or dark sysadmin scripting or even magic computer time travel!
Its actually a lot simpler than that. Simply it was copied. But it does put you in a peculiar situation.
When do we consider the file to be created? The moment it was conceived or the moment it arrived on this disk. Here’s an even better mind twister.
Consider that you have a script that copies files from file shares to a central repository and then deletes files older than say 30 days. Well the files would be greater than 30 days old before they get deleted. Since the dates created date would be the date that the file was copied to the disk. This is if you only copy the file once.
There is no simple solution to this one, but its worth keeping in mind the next time that you want to write a script.
I sometimes like to make use of time stamps in the names. These should never change in automated systems.