Everyone puts their phone on a charger at night.
Why not backup your data when that happens too?
There are two methods of modifying your charger setup to accomodate this:
Old-school solution: Having your old laptop under the bed that your charge cable plugs into, with a batch script that copies your files when your phone is plugged in at your night-stand.
Cleaner solution: If your phone supports OTG while charging, use an OTG+charge cable to make a direct backup to a flash drive while charging.
Old-school solution disadvantage: will require a laptop to be running all the time, and Androids do not mount a drive letter, making it difficult to back up automatically.
Cleaner solution potential disadvantage: requires Android kernel that allow OTG while charging.
Clean solution will also require an OTG+Charge cable: (Amazon)
Once you have that, you can plug your existing charger cable into the female end, and hook up a 32GB flash drive into the USB port, or a FAT32 HDD that you can stow underneath your bed.
The software side is pretty easy with the OTG cable thanks to Android:
Download Tasker from Play Store, setup a "profile" Profile>State>USB connected
and create a new Task to copy your files you need copied. You may also have to run a task to delete old copies on the flash drive before it gets full.
Tasker UI screenshot:
This guide has some good shell commands for copying all of your pictures to external media via Tasker: Tasker shell copy DCIM pictures
The guide let's us in on a shortcut to copy all .jpg files:
cp /sdcard/*.jpg /storage/USBDriveA/backups/
If OTG+Charge doesn't end up working for you, you can try the old laptop trick.
You'll have to use a Scheduled Task to launch a batch file in middle of the night. Here's an idea of what the batch file will do:
adb pull /sdcard/DCIM
pull: building file list...
pull: /sdcard/DCIM/090313-110415.jpg -> ./090313-110415.jpg
pull: /sdcard/DCIM/090313-110412.jpg -> ./090313-110412.jpg
pull: /sdcard/DCIM/090313-110408.jpg -> ./090313-110408.jpg
pull: /sdcard/DCIM/090313-110406.jpg -> ./090313-110406.jpg
pull: /sdcard/DCIM/090313-110404.jpg -> ./090313-110404.jpg
5 files pulled. 0 files skipped.
61 KB/s (338736 bytes in 5.409s)
adb pull
basically just copies the files (or folder in this case) to the working directory of adb.exe
.
I hope this helps!