Hey folks, I hacked this up today for my own use. It will synchronize any item folder @ archive.org (default is 0mhz-dos) with a local directory. Unlike the other download script I saw mentioned here, it doesn't need to parse XML, works for any archive.org folder not just 0mhz, does not use the 0mhz git repository, but instead fetches the current state of the archive.org folder -through the JSON API- then calculates what has changed (file size, mtime, md5 hash) and proceeds to synchronize. It can also hash all the files and check for corruption.
archive.org folder synchronization script [0mhz-dos]
- HerrBerzerk
- Posts: 273
- Joined: Tue Feb 01, 2022 1:45 pm
- Has thanked: 122 times
- Been thanked: 39 times
Re: archive.org folder synchronization script [0mhz-dos]
Is this to execute on the Mister or on a desktop? And does it synchronize to the local folder where the script is or can I configure a folder?
And what does "# Change these to GNU on macOS as BSD versions will not do" mean?
Sorry, might be very basic questions, but I've never written a script.
Re: archive.org folder synchronization script [0mhz-dos]
You can do both, the Mister Linux distribution comes with all the utilities the script needs already installed.
And does it synchronize to the local folder where the script is or can I configure a folder?
It will synchronize to the local directory you execute the script from. This doesn't need to be the same directory where you have the script installed. Example:
Code: Select all
cp aorg-sync.sh /media/fat/Scripts
mkdir -p /media/fat/games/AO486/0mhz && cd /media/fat/games/AO486/0mhz
/media/fat/Scripts/aorg-sync.sh # Will proceed to sync into /media/fat/games/AO486/0mhz
And what does "# Change these to GNU on macOS as BSD versions will not do" mean?
If you're running the script on macOS (or another BSD distribution), you'll need to install GNU coreutils (e.g. from macports or homebrew) as the BSD versions of these utilities do not support the same features. This does no affect executing on Mister or Linux.
Re: archive.org folder synchronization script [0mhz-dos]
Thanks for this script! I am getting this error though:
Code: Select all
curl: (60) SSL certificate problem: self signed certificate in certificate chain
Re: archive.org folder synchronization script [0mhz-dos]
SirBeers wrote: ↑Sat Apr 27, 2024 6:40 pmThanks for this script! I am getting this error though:
Code: Select all
curl: (60) SSL certificate problem: self signed certificate in certificate chain
Follow the directions here to install missing certificates on your Mister, or run the script (I just updated it) with --no-check-cert.
If you are running it on a Linux distribution other than Mister, there's usually a package you can install with common CA certificates e.g. on Debian it's ca-certificates.
- HerrBerzerk
- Posts: 273
- Joined: Tue Feb 01, 2022 1:45 pm
- Has thanked: 122 times
- Been thanked: 39 times
Re: archive.org folder synchronization script [0mhz-dos]
blktiger wrote: ↑Sat Apr 27, 2024 12:53 pmYou can do both, the Mister Linux distribution comes with all the utilities the script needs already installed.
And does it synchronize to the local folder where the script is or can I configure a folder?
It will synchronize to the local directory you execute the script from. This doesn't need to be the same directory where you have the script installed. Example:
Code: Select all
cp aorg-sync.sh /media/fat/Scripts mkdir -p /media/fat/games/AO486/0mhz && cd /media/fat/games/AO486/0mhz /media/fat/Scripts/aorg-sync.sh # Will proceed to sync into /media/fat/games/AO486/0mhz
Thank you very much, I understand now.
Re: archive.org folder synchronization script [0mhz-dos]
Sorry I'm having trouble with the REMOTE= option. I tried:
Code: Select all
/media/fat/Scripts/aorg-sync.sh --no-check-cert REMOTE=TGODFloppyCollection
And the script still downloaded everything from the 0mhz-dos link.
Re: archive.org folder synchronization script [0mhz-dos]
If you are overriding environment variables when starting a script, they should go before the script. That's also how it's document on the GitHub page, as far as I can tell.
So the following should theoretically work. Haven't tested it though.
Code: Select all
REMOTE=TGODFloppyCollection /media/fat/Scripts/aorg-sync.sh --no-check-cert
Re: archive.org folder synchronization script [0mhz-dos]
To get it to work with a different archive I had to change this line in the script to allow curl to create directories.
Code: Select all
CURL_ARGS=(--create-dirs -RSLf#)