archive.org folder synchronization script [0mhz-dos]

User avatar
blktiger
Posts: 8
Joined: Thu Mar 21, 2024 7:17 pm
Been thanked: 6 times

archive.org folder synchronization script [0mhz-dos]

Unread post by blktiger »

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.

https://github.com/atomontage/aorg-sync

User avatar
HerrBerzerk
Posts: 244
Joined: Tue Feb 01, 2022 1:45 pm
Has thanked: 105 times
Been thanked: 31 times

Re: archive.org folder synchronization script [0mhz-dos]

Unread post by HerrBerzerk »

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.

User avatar
blktiger
Posts: 8
Joined: Thu Mar 21, 2024 7:17 pm
Been thanked: 6 times

Re: archive.org folder synchronization script [0mhz-dos]

Unread post by blktiger »

HerrBerzerk wrote: Sat Apr 27, 2024 8:10 am

Is this to execute on the Mister or on a desktop?

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.

SirBeers
Posts: 10
Joined: Sat Apr 27, 2024 2:22 am

Re: archive.org folder synchronization script [0mhz-dos]

Unread post by SirBeers »

Thanks for this script! I am getting this error though:

Code: Select all

curl: (60) SSL certificate problem: self signed certificate in certificate chain
User avatar
blktiger
Posts: 8
Joined: Thu Mar 21, 2024 7:17 pm
Been thanked: 6 times

Re: archive.org folder synchronization script [0mhz-dos]

Unread post by blktiger »

SirBeers wrote: Sat Apr 27, 2024 6:40 pm

Thanks 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.

User avatar
HerrBerzerk
Posts: 244
Joined: Tue Feb 01, 2022 1:45 pm
Has thanked: 105 times
Been thanked: 31 times

Re: archive.org folder synchronization script [0mhz-dos]

Unread post by HerrBerzerk »

blktiger wrote: Sat Apr 27, 2024 12:53 pm

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

Thank you very much, I understand now.

Post Reply