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: 244
- Joined: Tue Feb 01, 2022 1:45 pm
- Has thanked: 106 times
- Been thanked: 31 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: 244
- Joined: Tue Feb 01, 2022 1:45 pm
- Has thanked: 106 times
- Been thanked: 31 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.