Recalbox Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • recalbox.com
    • Gitlab repository
    • Documentation
    • Discord

    Solved Syncing saves

    Recalbox General
    syncing saves
    4
    18
    4031
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Substring
      Substring @MinZe last edited by

      @minze then the best would probably to add a custom init script that would sync at stop

      Former dev - Please reply with @substring so that i am notified when you answer me
      Ex dev - Merci de me répondre en utilisant @substring pour que je sois notifé

      1 Reply Last reply Reply Quote 0
      • MinZe
        MinZe last edited by

        Right now I'm trying to install syncthing but I can't install the package... is there any way? apt-get and things like that doesn't work

        1 Reply Last reply Reply Quote 0
        • idarius
          idarius last edited by

          hi, i think you can use rsync in a script.
          To install new command you need to compil recalbox youself, there is no apt-get.
          rsync is already in recalbox.

          MinZe 1 Reply Last reply Reply Quote 0
          • MinZe
            MinZe @idarius last edited by

            @idarius Thanks, Im giving a look at it.

            1 Reply Last reply Reply Quote 0
            • MinZe
              MinZe last edited by

              I have been able to sync saves to google drive thanks to rclone, which uses rsync. now what I need is to know how to activate an script everytime a game is closed

              voljega 1 Reply Last reply Reply Quote 0
              • voljega
                voljega Banned @MinZe last edited by

                @minze you should add a command launch in python script emulatorlauncher.py

                MinZe 1 Reply Last reply Reply Quote 0
                • MinZe
                  MinZe @voljega last edited by

                  @voljega Yeah, I figured out at midnight, the thing is that right now I think that I wasn't able to execute-it.
                  this is my code for the .sh:

                  #!/bin/bash
                  rclone sync gdmedia:rpi /recalbox/share/saves/
                  echo finished
                  

                  and this is for my emulatorlauncher.py

                  [...]
                  def main(args):
                      subprocess.call('./syncFiles.sh')
                      playersControllers = dict()
                      if not args.demo:
                  [...]
                  

                  what am I doing wrong?

                  PS: As soon as I fix that I'll make a tutorial, because there is no one yet on how to sync files with drive/dropbox/etc

                  voljega 2 Replies Last reply Reply Quote 0
                  • voljega
                    voljega Banned @MinZe last edited by

                    @minze well first your script should be launched after the emulator was launched, you some to launch it before

                    also I personnaly use os.popen to launch command :
                    os.popen('cp -R '+whdFilespath+'/* '+mountPointWHDL)

                    you can also look into utils/runner.py and Command.py for something a little more complicated, but perfectly tweakable.

                    and keep your modifications backed up because all of that can be erased at each update

                    MinZe 1 Reply Last reply Reply Quote 0
                    • MinZe
                      MinZe @voljega last edited by MinZe

                      @voljega Well that was an script to see if it worked because it produces changes easy to see.
                      And the script should be launched everytime a game is ran right? at least that's what I thought.
                      Should I modify the script like that?
                      edit:(I've modified the .sh to have an start argument)

                      if __name__ == '__main__':
                          signal.signal(signal.SIGINT, signal_handler)
                      
                          pa**er = argpa**e.ArgumentPa**er(description='emulator-launcher script')
                          pa**er.add_argument("-p1index", help="player1 controller index", type=int, required=False)
                          pa**er.add_argument("-p1guid", help="player1 controller SDL2 guid", type=str, required=False)
                          pa**er.add_argument("-p1name", help="player1 controller name", type=str, required=False)
                          pa**er.add_argument("-p1devicepath", help="player1 controller device", type=str, required=False)
                          pa**er.add_argument("-p1nbaxes", help="player1 controller number of axes", type=str, required=False)
                          pa**er.add_argument("-p2index", help="player2 controller index", type=int, required=False)
                          pa**er.add_argument("-p2guid", help="player2 controller SDL2 guid", type=str, required=False)
                          pa**er.add_argument("-p2name", help="player2 controller name", type=str, required=False)
                          pa**er.add_argument("-p2devicepath", help="player2 controller device", type=str, required=False)
                          pa**er.add_argument("-p2nbaxes", help="player2 controller number of axes", type=str, required=False)
                          pa**er.add_argument("-p3index", help="player3 controller index", type=int, required=False)
                          pa**er.add_argument("-p3guid", help="player3 controller SDL2 guid", type=str, required=False)
                          pa**er.add_argument("-p3name", help="player3 controller name", type=str, required=False)
                          pa**er.add_argument("-p3devicepath", help="player3 controller device", type=str, required=False)
                          pa**er.add_argument("-p3nbaxes", help="player3 controller number of axes", type=str, required=False)
                          pa**er.add_argument("-p4index", help="player4 controller index", type=int, required=False)
                          pa**er.add_argument("-p4guid", help="player4 controller SDL2 guid", type=str, required=False)
                          pa**er.add_argument("-p4name", help="player4 controller name", type=str, required=False)
                          pa**er.add_argument("-p4devicepath", help="player4 controller device", type=str, required=False)
                          pa**er.add_argument("-p4nbaxes", help="player4 controller number of axes", type=str, required=False)
                          pa**er.add_argument("-p5index", help="player5 controller index", type=int, required=False)
                          pa**er.add_argument("-p5guid", help="player5 controller SDL2 guid", type=str, required=False)
                          pa**er.add_argument("-p5name", help="player5 controller name", type=str, required=False)
                          pa**er.add_argument("-p5devicepath", help="player5 controller device", type=str, required=False)
                          pa**er.add_argument("-p5nbaxes", help="player5 controller number of axes", type=str, required=False)
                          pa**er.add_argument("-system", help="select the system to launch", type=str, required=True)
                          pa**er.add_argument("-rom", help="rom absolute path", type=str, required=True)
                          pa**er.add_argument("-emulator", help="force emulator", type=str, required=False)
                          pa**er.add_argument("-core", help="force emulator core", type=str, required=False)
                          pa**er.add_argument("-ratio", help="force game ratio", type=str, required=False)
                          pa**er.add_argument("-demo", help="mode demo", type=bool, required=False)
                          pa**er.add_argument("-netplay", help="host/client", type=str, required=False)
                      
                          args = pa**er.pa**e_args()
                          command = './syncFiles.sh start'
                          os.popen(command)
                          exitcode = main(args)
                          time.sleep(1)
                          exit(exitcode)
                          
                      
                      voljega 1 Reply Last reply Reply Quote 0
                      • voljega
                        voljega Banned @MinZe last edited by

                        @minze there no way you're in the right folder when launching the script so either try to use the absolute path or move to it before launching it

                        MinZe 1 Reply Last reply Reply Quote 0
                        • MinZe
                          MinZe @voljega last edited by

                          @voljega Ooh, I thought that as I that script was in the same folder that the py, I could use that, yeah it makes sense that it doesn't make sense. Thanks ❤ i'll try it as soon as I arrive home.

                          1 Reply Last reply Reply Quote 0
                          • voljega
                            voljega Banned @MinZe last edited by

                            Cool hope it works

                            @minze said in Syncing saves:

                            PS: As soon as I fix that I'll make a tutorial, because there is no one yet on how to sync files with drive/dropbox/etc

                            You can also work on official integration, because this is a feature that users regularly ask for 😉

                            MinZe 1 Reply Last reply Reply Quote 0
                            • MinZe
                              MinZe @voljega last edited by

                              @voljega Yeah, I'll take a look at it too

                              Substring 1 Reply Last reply Reply Quote 0
                              • Substring
                                Substring @MinZe last edited by

                                @minze your script is anyway launched before the emulator, i thought you wanted it right after ?

                                Former dev - Please reply with @substring so that i am notified when you answer me
                                Ex dev - Merci de me répondre en utilisant @substring pour que je sois notifé

                                MinZe 1 Reply Last reply Reply Quote 0
                                • MinZe
                                  MinZe @Substring last edited by

                                  @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
                                  1 Reply Last reply Reply Quote 0
                                  • First post
                                    Last post

                                  Want to support us ?

                                  94
                                  Online

                                  99.6k
                                  Users

                                  28.1k
                                  Topics

                                  187.1k
                                  Posts

                                  Copyright © 2021 recalbox.com