After some failed attempts in using Powershell to make a backup of the files (I'm bad I know), I managed to get a working setup in Windows using a combination of
wget and Task Scheduler. If anyone is interested in making regular backups of the files provided by @joker_josue (and isn't very tech savy) you can use the following guide for Windows (thank you TryNinja for an alternative path) and Linux (thank you @LoyceV!):
WINDOWSPrerequisites: Grab
wget.exe from here[1].
The code that I'll be using for creating the task can be one of these:
wget --progress=bar:force -r -c -nd -A.zip -np
Resuming each command:
- --progress=bar:force : Displays a progress bar for each file that you will eventually download;
- -r : Recursive downloading. This option is responsible for downloading each file from the given URL;
- -c : Checks if the files already exist on the folder. If they do, they aren't downloaded again. If they exist, the download continues from where it ended;
- -nd : Prevents creating subfolders in the directory where the files are being saved;
- -A.zip : Will only look for files ending in ".zip";
- -np : Wget won't go up in the directory that is currently browsing/using;
If you'd like to have a different output folder for your files, there's a slightly variation of the code that you may use:
wget --progress=bar:force -r -c -nd -A.zip -np -P
The new argument (
-P) will force wget to download the files to the directory that is provided by you.
As for creating the task:
Open Task SchedulerThis can be done by pressing the Windows Key and typing "Task Scheduler"
Creating and setting up the taskClick in
"Create Basic Task" in the main window that opens as soon as you complete the previous step:
In the new menu that appears, name your task. I've named it "TalkImg Backup" and didn't provided an optional description (which is fine). Click
"Next":
In this new menu you're free to choose how often this task will trigger. Considering that the website makes weekly backups (of the previous week), I've selected
"Weekly". Click
"Next":
I'm assuming that the backups will always be updated on a Sunday (as per last updated package). As such, select
"Monday". You can also choose at which time the download occurs (for this example I've selected 08:00 (am)). When you're done setting up, click
"Next":
On the next menu click on
"Start a program" and then
"Next":
On this new menu you get two important fields that need to be filled out:
- Program/script: This is where you should type the path to the wget executable provided earlier[1]. As an example I've added "D:\wget.exe"
- Add arguments (optional): This will be the command line that you'll "feed" to wget shared previously[1]. Since I want the output files to be downloaded to a different directory, I've chosen the following command line:
wget --progress=bar:force -r -nd -A.zip -np -P "D:\TalkImg Backup" https://talkimg.com/tempbackups/
When you're done, press
"Next".
In the next menu you'll be able to review your task settings. For this example, the script will run
"Weekly; At 08:00 every Monday of every week, starting 08/06/2023". If everything looks OK, just go ahead and click on
"Finish":
TryNinja CMD methodTo whoever prefers using the command line, you can also create the task with this command:
SCHTASKS /Create /TN "TalkImg Backup" /SC WEEKLY /D MON /ST 08:00 /TR "C:\path\to\wget.exe --progress=bar:force -r -nd -A.zip -np -P \"D:\TalkImg Backup\"
https://talkimg.com/tempbackups/"
Just make sure to change the path to where wget.exe is located and also where to save the files (i.e D:\TalkImg Backup\).
LINUXI use this on Linux in a cronjob:
#!/bin/bash
cd /data/backup_talkimg
sleep $(( $RANDOM % 22 ))h; sleep $(( $RANDOM % 59 ))m # Random time each day
wget -q --no-parent -rcA.zip https://www.talkimg.com/tempbackups/
There's one flaw: if joker_josue would replace an old .zip by something else with the same name, it would overwrite my local file. But my local "Time Machine" backups make sure I won't lose files that way.
I use a random time to spread server bandwidth. It takes only a second to run again, so it doesn't matter to use daily checks for new data.
Congratulations! You've created you task and you are now acting as a backup agent for the images hosted on TalkImg. Horray!
CHANGELOG- 10/06/2023: Added "-c" argument in the command.
- 11/06/2023: Added Linux guide and alternative method for Windows. Thank you both LoyceV and TryNinja!
[1]
https://eternallybored.org/misc/wget/