Recalbox Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • recalbox.com
    • Gitlab repository
    • Documentation
    • Discord
    1. Home
    2. MinZe
    • Profile
    • Following 0
    • Followers 0
    • Topics 6
    • Posts 20
    • Best 1
    • Controversial 0
    • Groups 0

    MinZe

    @MinZe

    3
    Reputation
    402
    Profile views
    20
    Posts
    0
    Followers
    0
    Following
    Joined Last Online
    Website aitordev.com Location Spain

    MinZe Unfollow Follow

    Best posts made by MinZe

    • [Tutorial] How to sync saves/roms to the cloud

      Hello, I've managed to run rclone to have synced any folder on almost any cloud.
      The clouds available are all those listed here: https://rclone.org/

      Step 1: Download the necessary files.

      open ssh and run those commands:

      cd ~
      mkdir -p rpi-sync    
      wget -O rclone-install.sh https://raw.github.com/pageauc/rclone4pi/master/rclone-install.sh   
      wget -O rclone-sync.sh https://raw.github.com/pageauc/rclone4pi/master/rclone-sync.sh   
      wget -O rpi-sync/Readme.md https://raw.github.com/pageauc/rclone4pi/master/Readme.md
      

      now we have all the necessary files, but we have to modify rclone-install.sh
      run: nano ./rclone-install.sh
      Delete all the sudo on the file, at the end you should have something like that:
      0_1524321467750_Screenshot from 2018-04-21 16-33-36.png
      now let's finish with the commands

      chmod +x rclone-install.sh
      chmod +x rclone-sync.sh
      ./rclone-install.sh 
      

      Step 2: Add an account

      Go to https://rclone.org/docs/ and pick any cloud service.
      The steps don't change for Recalbox (at least for Google Drive, which is what I used).

      Step 3: Execute it on start

      Now that we can sync saves, it's time to automate it.
      We have to create a startup script; run:

      cd /etc/init.d/
      nano ./S99Sync
      

      Now we will create the startup script

      #!/bin/bash
      case "$1" in
              start)
      # check that is online to run the first sync command
      while :
      do
              wget -q --spider http://google.com
              if [ $? -eq 0 ]; then
                      # Run the command that will execute only once at the start
                      # this is for GDive, it will copy every folder and file
                      # and it'll delete those that have been deleted
                      /usr/bin/rclone sync gdmedia:rpi /recalbox/share/saves/ &
                      wait $!
                      break
              else
              fi
      done
      # This is the main loop
      while :
      do
              # I prefer to have an external script to run my rclone commands
              /etc/init.d/Copy.sh &
              # the wait will make this script wait until the Copy.sh has finished
              # it's important not to run twice any rclone script at the same time
              wait $!
      done
      ;;
      stop)
      rclone copy /recalbox/share/saves/ gdmedia:rpi
      ;;
      restart|reload)
      rclone copy /recalbox/share/saves/ gdmedia:rpi
      
      ;;
      *)
      esac
      
      exit $?
      

      Exit and save that file.
      Now we will create the Copy.sh file that will have our scripts

      nano ./Copy.sh
      

      This is what I have:

      /usr/bin/rclone copy /recalbox/share/saves/ gdmedia:rpi
      

      This copies the new/modified folders/files from /recalbox/share/saves/ to my google drive folder called rpi
      You can do whatever you want to be executed all the time there.
      Now let's make them executable

      chmod +x Sync
      chmod +x Copy.sh
      

      Perfect! now if you restart your recalbox.... it won't work.
      Even though you can run it from any ssh and it'll work, it won't work itself we have to fix something more

      Step 4: Make it work

      make sure to do this step everytime that you change your rclone configuration.
      You have to copy the rclone.conf from /recalbox/share/system/.config/rclone to /.config/rclone
      I did it manually, but you should be able to do it with this command
      cp -i /recalbox/share/system/.config/rclone/rclone.conf /.config/rclone

      Problems

      1. The startup of any game will be from 1 to 15 seconds slower.

      Special Thanks

      Special thanks to @substring and @voljega for all the help provided to me with this.
      And of course rclone for making this possible, and pageauc for making the rclone4pi

      Sync more things than saves

      I made that to only sync saves, but you are able to sync everything that you want, just change the folder where you want to sync and that you want to sync

      posted in Your discoveries
      MinZe
      MinZe

    Latest posts made by MinZe

    • How to emulate nintendo ds?

      Hello, is there any known way to emulate ds with drastic? With retropie works perfectly.
      If there isn't, how can I package the emulator (I know there is no apt get) and test it?

      posted in Emulator Arcade/PC/Console
      MinZe
      MinZe
    • RE: [Tutorial] How to sync saves/roms to the cloud

      @substring It's true I forgot that, is there any way to edit the post? Can't find it though I can for answers.
      And yeah it can be risky, I haven't thought about that

      posted in Your discoveries
      MinZe
      MinZe
    • [Tutorial] How to sync saves/roms to the cloud

      Hello, I've managed to run rclone to have synced any folder on almost any cloud.
      The clouds available are all those listed here: https://rclone.org/

      Step 1: Download the necessary files.

      open ssh and run those commands:

      cd ~
      mkdir -p rpi-sync    
      wget -O rclone-install.sh https://raw.github.com/pageauc/rclone4pi/master/rclone-install.sh   
      wget -O rclone-sync.sh https://raw.github.com/pageauc/rclone4pi/master/rclone-sync.sh   
      wget -O rpi-sync/Readme.md https://raw.github.com/pageauc/rclone4pi/master/Readme.md
      

      now we have all the necessary files, but we have to modify rclone-install.sh
      run: nano ./rclone-install.sh
      Delete all the sudo on the file, at the end you should have something like that:
      0_1524321467750_Screenshot from 2018-04-21 16-33-36.png
      now let's finish with the commands

      chmod +x rclone-install.sh
      chmod +x rclone-sync.sh
      ./rclone-install.sh 
      

      Step 2: Add an account

      Go to https://rclone.org/docs/ and pick any cloud service.
      The steps don't change for Recalbox (at least for Google Drive, which is what I used).

      Step 3: Execute it on start

      Now that we can sync saves, it's time to automate it.
      We have to create a startup script; run:

      cd /etc/init.d/
      nano ./S99Sync
      

      Now we will create the startup script

      #!/bin/bash
      case "$1" in
              start)
      # check that is online to run the first sync command
      while :
      do
              wget -q --spider http://google.com
              if [ $? -eq 0 ]; then
                      # Run the command that will execute only once at the start
                      # this is for GDive, it will copy every folder and file
                      # and it'll delete those that have been deleted
                      /usr/bin/rclone sync gdmedia:rpi /recalbox/share/saves/ &
                      wait $!
                      break
              else
              fi
      done
      # This is the main loop
      while :
      do
              # I prefer to have an external script to run my rclone commands
              /etc/init.d/Copy.sh &
              # the wait will make this script wait until the Copy.sh has finished
              # it's important not to run twice any rclone script at the same time
              wait $!
      done
      ;;
      stop)
      rclone copy /recalbox/share/saves/ gdmedia:rpi
      ;;
      restart|reload)
      rclone copy /recalbox/share/saves/ gdmedia:rpi
      
      ;;
      *)
      esac
      
      exit $?
      

      Exit and save that file.
      Now we will create the Copy.sh file that will have our scripts

      nano ./Copy.sh
      

      This is what I have:

      /usr/bin/rclone copy /recalbox/share/saves/ gdmedia:rpi
      

      This copies the new/modified folders/files from /recalbox/share/saves/ to my google drive folder called rpi
      You can do whatever you want to be executed all the time there.
      Now let's make them executable

      chmod +x Sync
      chmod +x Copy.sh
      

      Perfect! now if you restart your recalbox.... it won't work.
      Even though you can run it from any ssh and it'll work, it won't work itself we have to fix something more

      Step 4: Make it work

      make sure to do this step everytime that you change your rclone configuration.
      You have to copy the rclone.conf from /recalbox/share/system/.config/rclone to /.config/rclone
      I did it manually, but you should be able to do it with this command
      cp -i /recalbox/share/system/.config/rclone/rclone.conf /.config/rclone

      Problems

      1. The startup of any game will be from 1 to 15 seconds slower.

      Special Thanks

      Special thanks to @substring and @voljega for all the help provided to me with this.
      And of course rclone for making this possible, and pageauc for making the rclone4pi

      Sync more things than saves

      I made that to only sync saves, but you are able to sync everything that you want, just change the folder where you want to sync and that you want to sync

      posted in Your discoveries
      MinZe
      MinZe
    • RE: daemon(startup script) not executing what ssh does

      @substring Thanks to that I've found that on the daemon, it searched for one .conf on another place. Now I've solved and it's fully working without problem.
      If I have time, this weekend I'll make the tutorial for recalbox. If I do it, it'll be at least for GDrive, maybe for onedrive too (can't promise anything as it should be almost the same).

      posted in Recalbox General
      MinZe
      MinZe
    • RE: daemon(startup script) not executing what ssh does

      @substring About the rclone, I haven't, I added the full path for rclone and still doesn't work like it does on ssh. The script that calls rclone I have done chmod u+x and it's in /etc/init.d/
      Is there someway to see the actual recalbox terminal without having to exit emulationstation and/or from the pc?

      posted in Recalbox General
      MinZe
      MinZe
    • RE: daemon(startup script) not executing what ssh does

      @voljega well the other posts' main problem are solved, but as the main thing is not, I haven put [solved] in the title

      posted in Recalbox General
      MinZe
      MinZe
    • daemon(startup script) not executing what ssh does

      Hello, my custom start script doesnt execute correctly what my ssh does... its about rclone (uses rsync) and even though it does the infinite and execute the echo and the recallog, the rclone's commands don't, while executing the same file over ssh allows me to do so.
      My daemon script works because it calls the other script with the command.
      the script that the daemon calls:

      #!/bin/bash
      rclone copy /recalbox/share/saves/ gdmedia:rpi > /dev/null
      

      edit: I tried without !/bin/bash too

      posted in Recalbox General
      MinZe
      MinZe
    • RE: Syncing saves

      @substring Yeah I want to execute the script:

      1. On start, once wifi is enabled.
      2. When any game is launched.
      3. if possible, when any game is closed
      posted in Recalbox General
      MinZe
      MinZe
    • RE: [bash/python] know if wifi is connected

      What I wanted to test was if it was connection it didn't matter if it was through wifi or ethernet, I have found an script that I will post here if it works.

      posted in Recalbox General
      MinZe
      MinZe
    • [bash/python] know if wifi is connected

      Is there anyway to know if wifi is connected?
      I need to run a script once wifi is connected for the first time, doing it on the startup it seems that it doesn't work because wifi is not connected yet

      posted in Recalbox General
      MinZe
      MinZe