Git Product home page Git Product logo

arklone-arkos's Introduction

arklone

rclone cloud sync utility for ArkOS

Watches save directories for RetroArch, and select standalone games.

This project offers no warranties or guarantees. Always make extra backup copies of your data. Use at your own risk!

arklone is released under a GNU GPLv3 license. See LICENSE.md for more information.

rclone, RetroArch, EmulationStation, and ArkOS are the properties of their respective owners.


Table of Contents

  1. Installation
  2. rclone Configuration
  3. First Run
  4. Settings Dialog
  5. Syncing with the Cloud
  6. Advanced RetroArch Configuration
  7. Recommended RetroArch Configuration
  8. Advanced arklone Configuration
  9. Troubleshooting
  10. Developers
  11. FAQ

 


Installation

This module is not yet integrated into ArkOS. See this pull request for updates.

To test, install manually by downloading the installation script, and run it from a terminal:

wget https://github.com/ridgekuhn/arkos/raw/cloudbackups/10092021/install.sh -O installArklone.sh
chmod a+x installArklone.sh
./installArklone.sh
rm ./installArklone.sh

 

Uninstallation

wget https://github.com/ridgekuhn/arkos/raw/cloudbackups/10092021/uninstall.sh -O uninstallArklone.sh
chmod a+x uninstallArklone.sh
./uninstallArklone.sh
rm ./uninstallArklone.sh

 


rclone Configuration

To begin using arklone, you must create an rclone config file. For most cloud providers, this will involve installing rclone to a computer with a web browser, like your desktop or laptop. See the rclone docs for more information on how to do this for your specific provider. Make sure you install the latest version of rclone, (1.56.2 as of this writing) to your desktop or laptop. If you use a package manager like apt, the repository version will be outdated.

Once you have completed this process, copy the rclone.conf file from your computer to your ArkOS device. Your rclone.conf can be located by running:

rclone config file

On your ArkOS SD card, copy rclone.conf to: EASYROMS/backup/rclone/rclone.conf

If you already had rclone installed on your device, your rclone.conf has been moved to EASYROMS for easier access, and symlinked to its original location. arklone will restore the original arrangement if uninstalled.

 


First Run

From EmulationStation, navigate to Options -> Cloud Settings

On first run, you will be greeted by a prompt asking if you'd like to change your RetroArch configurations to the recommended settings.

Obviously, this is recommended!

This will set the following settings in your retroarch.cfg (and your retroarch32/retroarch.cfg):

savefile_directory = "~/.config/retroarch/saves"
savefiles_in_content_dir = "false"
sort_savefiles_enable = "false"
sort_savefiles_by_content_enable = "true"

savestate_directory = "~/.config/retroarch/saves"
savestates_in_content_dir = "false"
sort_savestates_enable = "false"
sort_savestates_by_content_enable = "true"

This will result in savefiles and savestates being stored in the same directory hierarchy as your RetroArch content root, in ~/.config/retroarch/saves

eg, ~/.config/retroarch/saves/nes/TheLegendOfZelda.srm ~/.config/retroarch/saves/nes/TheLegendOfZelda.savestate0

First run screen

 


Settings Dialog

  • Set cloud remote Allows you to select from the remotes you set up in rclone.conf
  • Manually sync saves Manually send/receive from the cloud remote
  • Enable/Disable automatic saves sync Watches directories for changes and syncs them to your selected remote.
  • Manual backup/sync ArkOS settings Runs the ArkOS backup script and uploads the file to the selected remote.
  • Regenerate RetroArch path units Re-scans for new RetroArch directories to watch and generates path units for them.
  • View log file Shows the log file.

Arklone main menu

 


Syncing with the Cloud

Keeping multiple devices synced can be difficult. arklone tries to do its best, but you should always keep an extra backup copy just in case.

Automatic Syncing

If you enable automatic syncing in the settings dialog, arklone assumes the copy of your data stored in the cloud is the canonical and "always correct" version. On system boot, arklone will run before EmulationStation and attempt to receive updates from the cloud remote. If the remote contains a newer version of a file, it will overwrite the local copy. On this initial sync, arklone only receives updates and does not send anything back.

If the boot sync process succeeds, arklone will begin watching all your save directories, and send updates any time a write is detected, overwriting older versions on the cloud remote. It will also receive updates at the interval set when you enabled automatic syncing.

If the boot process fails or is cancelled by the user, the user is given the chance to try again, or the dirty boot state is set.

Manual Syncing

The manual sync dialog allows you to send or receive any directory which has a path module registered with arklone.

 


Dirty Boot State

If automatic syncing is enabled and the boot sync process fails, the dirty boot state is set. Automatic syncing is disabled for the rest of the session, and will resume after the next boot. On the next boot, the user is shown a warning message about potential data loss before the boot sync proceeds.

To manually reset the dirtyboot state, delete the lock file located at: ~/.config/arklone/.dirtyboot

 


Advanced RetroArch Configuration

This section is for users who wish to have more control over their retroarch.cfg settings and save directories.

Supported RetroArch Configuration

ArkOS includes 64-bit and 32-bit builds of RetroArch. The configuration files are stored at /home/ark/.config/retroarch/retroarch.cfg and /home/ark/.config/retroarch32/retroarch.cfg.

The following settings are supported:

savefile_directory
savefiles_in_content_dir
sort_savefiles_enable
sort_savefiles_by_content_enable

savestate_directory
savestates_in_content_dir
sort_savestates_enable
sort_savestates_by_content_enable

For the next examples, filetype refers to either savefile or savestate.

If filetypes_in_content_dir = "true", it will override the other related settings, and create save data next to the content file.

Otherwise, if sort_filetypes_enable = "true", save data will be organized by libretro core inside filetype_directory. eg, /path/to/filetype_directory/FCEUmm/TheLegendOfZelda.srm

If sort_filetypes_by_content_enable = "true", save data will be organized by the parent directory of the content file. eg, /path/to/filetype_directory/nes/TheLegendOfZelda.srm

If both sort_filetypes_enable = "true" and sort_filetypes_by_content_enable = "true", save data will be organized by the parent directory of the content file, then by libretro core. eg, /path/to/filetype_directory/nes/FCEUmm/TheLegendOfZelda.srm

Known Bugs

ArkOS currently contains a bug which prevents systemd path units from watching subdirectories of exFAT partitions. (See issue #289.) This means that savefiles/savestates can not be watched (and automatically synced) if filetypes_in_content_dir = "true".

Until this bug is resolved, if you wish to store your saves next to the content, you must manually sync your saves from the arklone dialog.

Since the bug only applies to exFAT partitions, advanced users who really want to use automatic syncing and keep savefiles/savestates in the content directories can re-format the EASYROMS partition to FAT32, ext4, etc and edit the mount entry in /etc/fstab.

Recommended RetroArch Configuration

savefile_directory = "~/.config/retroarch/saves"
savefiles_in_content_dir = "false"
sort_savefiles_enable = "false"
sort_savefiles_by_content_enable = "true"

savestate_directory = "~/.config/retroarch/states"
savestates_in_content_dir = "false"
sort_savestates_enable = "false"
sort_savestates_by_content_enable = "true"

 


Advanced arklone Configuration

Arklone has a few settings that can be changed by the user, mostly paths where arklone looks for various files. The user configuration file is stored at ~/.config/arklone/arklone.cfg.

Resetting to "First Run" State

Setting remote to an empty string forces the settings dialog to show the "first run" screen again.

 

arklone.cfg

remote = ""

Changing RetroArch Content Root

Where filetype refers to either savefile or savestate:

If your retroarch.cfg contains the settings filetypes_in_content_dir = "true" or sort_filetypes_by_content_enable = "true", arklone expects your RetroArch content to be organized in a directory hierarchy with one level of subdirectories, where each contains all content for a particular platform. eg, retroarchContentRoot/nes/TheLegendOfZelda.rom

 

arklone.cfg

retroarchContentRoot = "/absolute/path/to/retroarchContentRoot"

arklone also supports select standalone software and "ports". See the systemd/units for a list, and the Path Units section of the developer docs for more info.

Multiple RetroArch Instances

arklone supports multiple instances of RetroArch, in case your distro has both 64-bit and 32-bit builds installed. Set retroarchCfg to a space-delimited list of absolute paths to each retroarch.cfg.

 

arklone.cfg

retroarchCfg = "/home/user/.config/retroarch/retroarch.cfg /home/user/.config/retroarch32/retroarch.cfg"

rclone Filters

arklone passes various filter lists to rclone when a sync script is run. See the Path Units and rclone Filters sections of the developer docs for more info.

 


Troubleshooting

RetroArch Saves Not Syncing

arklone only watches the RetroArch save directories it knew about when it first generated the corresponding path units. If you selected "Set Recommended Settings" on your first run, arklone will automatically generate path units for all your RetroArch content directories which are not empty. If you've added games since then and some of your save directories are not being synced automatically, try manually regenerating them from the arklone dialog menu.

If you change any of the above settings in retroarch.cfg, you must also manually regenerate the path units.

Ports, Standalone Apps, or Other Game Saves Not Syncing

ArkOS is constantly updated with new apps and ports, and we probably haven't caught up to them yet. Please create a new issue so we can include it in a future update.

Logging

To save unnecessary writes to your SD card or hard drive, arklone writes logs to the RAM filesystem at /dev/shm/arklone.log. This file disappears when the system is powered down, but you can view it by opening the arklone settings dialog and selecting "View log file".

 


Developers

Contributions are welcome! Please see the developer docs.

 


FAQ

Can I use it on Windows, MacOS, or other Linux Distros?

Linux

A RetroPie release is planned soon. arklone is written in bash, and relies on tools like apt, dpkg, and inotify-tools. It should theoretically work on any Debian-based distro, as long as your content is organized in the expected directory hierarchy. See Advanced arklone Configuration for more info.

Windows and MacOS

If your cloud provider offers a desktop client, you should install and use that instead.

Can I add my own custom directories?

See the Path Units section of the developer docs.

Can I Use arklone to Sync ROMs or BIOS files?

Not unless you want to set it up yourself. Many users' game libraries are massive and would probably exceed the storage limit on your cloud account several times over. There are also system performance implications for keeping this much data synced on low-power devices, like the ones ArkOS is designed for, where the background sync operations may affect gameplay. It's probably much faster/efficient to transfer your game libraries from device-to-device via USB or over your LAN.

Why Am I Seeing "Directory Not Found" Errors in the Log?

If you have automatic syncing enabled, arklone attempts to download all the different save directories it knows about from the cloud remote. If they don't exist on the cloud remote, these messages are generated for logging and debugging purposes. If there are any actual problems downloading save data from the cloud, you will be presented with a dialog screen, and asked if you want to proceed or view the log file. If you don't see this dialog screen and your device boots straight into EmulationStation, then everything is ok!

arklone-arkos's People

Contributors

ridgekuhn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

mdeguzis

arklone-arkos's Issues

Can you create a link to AM2R saves

Hello

I see you have some port saves set to sync to the cloud can you please add AM2R save folder. I tried to go through the doc to add my own but its far too complex for what i understand. If you could tell me what line to add and where to add it i could do that. Thank you

am2r saves (and game config file) are in /ports/am2r/conf/am2r/

or /home/ark/.config/amr2

Can't sync - symlink error

When I run a manual sync for just about anything, I get the error NOTICE: .q3a: Can't follow symlink without -L/--copy-links (it repeats a lot with different extensions.) Then finishes with There was nothing to transfer..

  • My roms are stored on the 2nd SD card, exFAT. (I'm assuming this is the issue somehow?)
  • Latest ArkOS on RG351MP.
  • (I'm not sure where the actual log file is stored so I can't copy/paste from it.)

Change Path in Google Drive

Where can I change the path of where saves are uploaded to for ex. i don't want it to arklone/retroarch/saves/"console" I want the destination on G Drive to go to retroarch/"console". IS THIS POSSIBLE?

THANKS!

Wrong filename for ArkOS Backup Settings on RGB10

First of all, amazing idea! It works really well.

On my RGB10, I noticed the manual backup/sync of ArkOS Settings fails because the script name is different than on RG351 devices (Backup Settings.sh vs Backup ArkOS Settings.sh).

Here is the log:

======================================================
Started new cloud sync at Sun 06 Jun 2021 01:15:06 PM EDT
------------------------------------------------------
Backing up your ArkOS settings...
bash: /opt/system/Advanced/Backup Settings.sh: No such file or directory

Could not create backup file! Exiting...

Here is what I get on RGB10 via SSH:

ark@rgb10:/opt/system/Advanced$ ls -l
total 48
-rwxrwxrwx 1 ark  ark  1417 Dec 16 00:35 'Backup ArkOS Settings.sh'
-rwxrwxrwx 1 ark  ark   975 May 20 23:03 'Clear Last Played Collection.sh'
-rwxr-xr-x 1 ark  ark   382 May  1 16:12 'Disable Low Battery Warning.sh'
-rwxr-xr-x 1 root root  380 May  1 15:47 'enable low battery warning.sh'
-rwxrwxrwx 1 ark  ark   194 Feb 25 01:16 'ES FullScreen.sh'
-rwxrwxrwx 1 ark  ark   191 Feb 25 01:16 'ES Header.sh'
-rwxrwxrwx 1 ark  ark   122 Nov 11  2020 'Fix ExFat Partition.sh'
-rwxrwxrwx 1 ark  ark   829 Feb  2 03:11 'Reset Retroarch32 Core Settings.sh'
-rwxrwxrwx 1 ark  ark   739 Apr 22 23:33 'Reset Retroarch32 Settings.sh'
-rwxrwxrwx 1 ark  ark   824 Feb  2 03:11 'Reset Retroarch Core Settings.sh'
-rwxrwxrwx 1 ark  ark   734 Apr 22 23:32 'Reset Retroarch Settings.sh'
-rwxrwxrwx 1 ark  ark   753 Nov 29  2020 'Restore ArkOS Settings.sh'

ScummVM doesn't backed up

I have some file with extension "sg0", "sg1", "sgx" for saved file of scummvm but they doesn't backed up by our script.
I have already manually set the folder for save to "configs\all\retroarch\saves\scummvm".

Does it work on RG35XX H?

Hi,
I used arklone on RG353V on ArkOS and I really liked it.
Now I would like to install on RG35XX H to sync saves between devices, is it possible?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.