Monday, January 16, 2017

Automation

I've been trying to automate more stuff.  Most recently, I used AutoIT to delete 4000 pages of fake assets.  So that was a great win.  I set the system to show 200 pages per item, and yet there were still 4000 pages.  When an import would fail, the system would create 65,536 new assets.  Do that 12 times and you end up with 800,000 assets.  That have to be deleted.  Manually.

Of course, if we were running the on-premise version of the software you could use a simple SQL command.  But we migrated off to the cloud.  So that was out of the question.

If you can't do it with SQL, then it's time to do it with some other method. 

Now, with 4,000 pages of stuff, at about 1.5 minutes per page deletion it would have taken me 12.5 work days to get rid of the fake assets.  Not happening. 

In the end, it took me about 4 hours.  30-45 minutes to write the original script.  Then another 3.5 hours dealing with crashes of the script to make tweaks.  Granted it was just a bunch of web page clicks, but sufficient time prevents those failures.  The main thing was adding time between the clicks. 

Click one button.
Wait 2 seconds.
Move to another location.
Click.
Wait 2 seconds.
Click. 
Wait 4 seconds.
Wait a minute.
Start script at line 1.

I wish I could have written a better script.  But I haven't become good enough at that.  So the scripts I end up writing are generally very specific to the computer being used.  Exact screen coordinates and what not. 

Anyways.  Enough of automation. 

Just realize: repetitive IT work can often be automated.  It just takes time and effort.  And documenting the large behaviors.   


No comments:

Post a Comment