drummerSupport
drummerSupport copied to clipboard
Suggested change to file name when downloading my files
It's great that backups are as simple as choosing "Download my files...". I'm wondering if it would be possible, when creating the zip file, if it could be named something more descriptive than "myfiles.zip".
I'd love a date stamp in the filename so that it's easier to spot when the backup was made. Something like DATETIME-USERNAME.zip e.g. 202110120433-jackbaty.zip. Or even 202110120433-drummer-jackbaty.zip, just to be even more explicit.
Thanks. Obviously not a priority, but maybe for someday.
You can script it yourself. If you hover over the "Download my files" you'll see a link with unique tokens in it. If you copy this link you can then use it elsewhere.
I like python so I picked that, but I'm sure curl, wget, bash etc. can do it too:
import requests as re
import time
url = 'http://drummer.scripting.com/myfiles?oauth_token=<your-token>&oauth_token_secret=<your-secret>'
filename = time.strftime("%Y-%m-%d.%H_%M_%S") + "-drummer-thealexjj.zip"
file = re.get(url, allow_redirects=True)
open(filename, 'wb').write(file.content)
Output is 2021-10-26.11_32_50-drummer-thealexjj.zip file. You could then have the script unzip the file, git commit it and push to a private repo or whatever :beers:
Thanks @alexjj. Nice solution! I may try something like this, but currently, all I'm doing is downloading and manually renaming, which isn't too big a stretch for something that happens once a day. The additional features you mention might make it worth it, though.
I still feel like the suggested modification to output naming would be generally useful for most people. Minor, but useful.
Thanks @alexjj for pointing out the URL. Using Zapier I set up a scheduled backup to go off once a day to save the file to a Dropbox folder. The workflow recipe is "Schedule by Zapier" --> "Dropbox".
I do this with a really long crontab entry. 😃
*/5 * * * * cd ~/DrummerOPMLBackup; /
wget -O /tmp/my.zip http://drummer.scripting.com/myfiles?oauth_token=<your-token>&oauth_token_secret=<your-secret> ; /
unzip -o /tmp/my.zip ; rm /tmp/my.zip ; git commit -am "`date`" ; git push
@kenbooth @papascott those are both awesome! Thanks for sharing.
@jackbaty You know what I just tried? I created Siri Shortcut. Two steps - Get URL contents and Save to Dropbox with today's date in path :-)
I just ask Siri now to back up my Drummer blog.
I just ask Siri now to back up my Drummer blog.
@am1t Showoff! :). (These are all great solutions and y'all are going to make me want to retract my request!)
@am1t Showoff! :)
Sorry, that wasn't the intention - but it just felt good to ask Siri to take backup :D
I added a rule in Hazel -- my Downloads folder collection has a dozen or so. This one looks for "myfiles", renames it with a date and moves it to my backups folder. I like the idea of automating the backup in the first place -- haven't tackled that yet. For me it will probably be Keyboard Maestro since JavaScript is still out in the future somewhere...
This is a support forum. That's all it's for. Don't post links to your products or websites.