Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    rfm - RepRapFirmware FileManager [duetbackup successor]

    Scheduled Pinned Locked Moved
    General Discussion
    24
    83
    10.9k
    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.
    • demonlibraundefined
      demonlibra
      last edited by

      Write script for bash (GNU/Linux) to backup all files.

      #!/bin/bash
      
      # ---------------------------------- Parameters -------------------------------------
      temp="temp"											# Temp folder for backup
      output="backup_rrf_$(date +%F_%H-%M-%S).tgz"		# Archive name for backup
      
      # -----------------------------------------------------------------------------------
      mkdir -p $temp										# Create temp folder
      
      ./rfm ls | while read line							# Parse list of files and folders
      	do
      		if [[ `echo "$line" | grep "\[f\]"` ]]		# Processing files
      			then
      				filename=`echo ${line##*	}`
      				./rfm download "$filename" "$temp/$filename"
      				echo "$filename - File downloaded"
      
      		elif [[ `echo "$line" | grep "\[d\]"` ]]	# Processing folders
      			then
      				foldername=`echo ${line##*	}`
      				./rfm backup -exclude overlays "$temp/$foldername" "$foldername"
      				echo -e "\n"
      
      		else echo "$line - Strange line"
      		fi
      	done
      		
      tar czPf "$output" "$temp"							# Create archive
      rm -rf "$temp"										# Delete temp folder
      
      
      1 Reply Last reply Reply Quote 0
      • Phaedruxundefined Phaedrux referenced this topic
      • Phaedruxundefined Phaedrux referenced this topic
      • jens55undefined
        jens55
        last edited by

        I am trying out rfm. I go into the folder that has rfm in it and do:
        ./rfm backup -domain 192.168.1.163
        this backs up the /sys folder on the duet card that is at 192.168.1.163.
        If I want to back up the macro folder on that Duet, what should the command look like? Based on the help section of rfm, I was trying ./rfm backup /macros -domain 192.168.1.163 but I get 'directory not found'.

        wilrikerundefined 1 Reply Last reply Reply Quote 0
        • Nightowlundefined
          Nightowl
          last edited by Nightowl

          Hi @wilriker

          This is a great project and I would like to implement it on my system, but I (generally) manage the system remotely.

          Specifically, I have a Mac (in the house) and use the Microsoft Remote Desktop (RD) app to connect to my Surface Pro (in the shed), via a wired network, which is hard-wired to the Duet3 MB6HC control board running my CNC machine (I don't run the CNC machine remotely, before anyone asks!)

          The first question I have is, should I install rfm on the Mac and run it from there, or install it on the Surface Pro and run rfm from the Mac (via RD), and the second question is, which version should I use if it's installed on the Mac?

          I'm running RRF version 3.4.4

          Thank you

          Few things are more dangerous than taking the advice of someone who thinks he knows what he's doing.
          I'm still on my learning curve, so take everything I say with caution!

          RatRig 1075, Duet3 MB6HC, Sorotec SFM 1000 PV-ER milling motor, Hobbyist

          wilrikerundefined 1 Reply Last reply Reply Quote 0
          • wilrikerundefined
            wilriker @jens55
            last edited by

            @jens55 said in rfm - RepRapFirmware FileManager [duetbackup successor]:

            If I want to back up the macro folder on that Duet, what should the command look like? Based on the help section of rfm, I was trying ./rfm backup /macros -domain 192.168.1.163 but I get 'directory not found'.

            You need to switch the order of parameters:

            rfm backup -domain 192.168.1.163 <local-path> 0:/macros
            

            Note that local-path is mandatory if you specify a remote path.

            Manuel
            Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
            with probably always latest firmware/DWC (incl. betas or self-compiled)
            My Tool Collection

            jens55undefined 1 Reply Last reply Reply Quote 1
            • wilrikerundefined
              wilriker @Nightowl
              last edited by

              @Nightowl said in rfm - RepRapFirmware FileManager [duetbackup successor]:

              The first question I have is, should I install rfm on the Mac and run it from there, or install it on the Surface Pro and run rfm from the Mac (via RD), and the second question is, which version should I use if it's installed on the Mac?

              Actually this just depends on what is more convenient for you. As long as rfm is able to connect to RRF via network this does not matter.

              I personally would probably install it on the Surface Pro just because it is closer. But again, it just boils down to what is more convenient for you. Mine is installed on a Raspberry Pi that is lingering around somewhere in the house and runs a background task that periodically checks if it can backup anything or not.

              If you want to install it an the Mac use darwin binary. Although this will not work on a M1 MacBook. When I compiled rfm the last time there were not M1's around AFAIR.

              Manuel
              Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
              with probably always latest firmware/DWC (incl. betas or self-compiled)
              My Tool Collection

              Nightowlundefined 2 Replies Last reply Reply Quote 1
              • Nightowlundefined
                Nightowl @wilriker
                last edited by

                Thank you, @wilriker

                Mine's an i5, so that would be OK - but logic, and your comments, tell me I should install it on the PC!

                Thank you 👍

                Few things are more dangerous than taking the advice of someone who thinks he knows what he's doing.
                I'm still on my learning curve, so take everything I say with caution!

                RatRig 1075, Duet3 MB6HC, Sorotec SFM 1000 PV-ER milling motor, Hobbyist

                1 Reply Last reply Reply Quote 0
                • jens55undefined
                  jens55 @wilriker
                  last edited by

                  @wilriker, thank you!

                  1 Reply Last reply Reply Quote 0
                  • Nightowlundefined
                    Nightowl @wilriker
                    last edited by Nightowl

                    @wilriker
                    Further to my last post, I'm a bit of a biff with these newfangled things, so I need a couple of simple steps to follow - at least I think I do.

                    I understand the file has to be run from the command line, but where would be the best folder to locate rfm? I appreciate it can be accessed wherever it is, but I would like to pre-configure everything, so it would be a simple process of 'clicking a shortcut' for the card to be 'backed up'.

                    I'm assuming all the folders (firmware, gcodes, macros, sys and www) should be backed up, but does rfm process them all (if the correct parameters are set, clearly) or do I need to run rfm for each folder?

                    This is what I think...

                    rfm backup Weeble O:/ //Libraries/CNC Files/Backups
                    

                    ...where Weeble is the device name, O:/the root of the SD card and afp://SynologyHome._afpovertcp._tcp.local/Libraries/CNC Files/Backups where the files are to be backed up to?

                    BTW, I haven't tested this yet!

                    Thank you.

                    EDIT: Is there a naming protocol for the backup files, or will they be overwritten every time they're backed up? P

                    Few things are more dangerous than taking the advice of someone who thinks he knows what he's doing.
                    I'm still on my learning curve, so take everything I say with caution!

                    RatRig 1075, Duet3 MB6HC, Sorotec SFM 1000 PV-ER milling motor, Hobbyist

                    Garth_42undefined wilrikerundefined 2 Replies Last reply Reply Quote 0
                    • Garth_42undefined
                      Garth_42 @Nightowl
                      last edited by

                      @wilriker I am getting the following error when I run the RFM tool. I have attempted on mac and PC, and have tried multiple variants of the command, too. My duet is a Duet3MB6HC in SBC mode running RRF 3.4.5.

                      Here is a screenshot of the output from terminal: 29d06f56-66d3-4130-907e-02eae2ed8ac6-image.png

                      Best,
                      Garth

                      wilrikerundefined 1 Reply Last reply Reply Quote 0
                      • wilrikerundefined
                        wilriker @Garth_42
                        last edited by

                        @Garth_42 rfm is intended to be used with boards in standalone-mode. AFAIR SBC builds do not support the full HTTP interface for file management plus any SBC has much more powerful means to interact with files than I could ever implement. 😉

                        Manuel
                        Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
                        with probably always latest firmware/DWC (incl. betas or self-compiled)
                        My Tool Collection

                        Garth_42undefined 1 Reply Last reply Reply Quote 1
                        • wilrikerundefined
                          wilriker @Nightowl
                          last edited by

                          @Nightowl Sorry for the very late reply. First of all rfm has an extensive help page, accessible via rfm help as well as rfm help <command> to get more details on specific commands.

                          rfm backup Weeble 0:/ //Libraries/CNC Files/Backups
                          

                          looks somehow wrong to me. Most likely you missed -device in front of "Weeble". Also beyond that you have further three parameters where rfm only expects two, namely the local path (to write the backup to) and the remote path a.k.a. path on the Duet (specifically in this order). So your command rather likely should look like

                          rfm backup -device Weeble //Libraries/CNC 0:/
                          

                          but where would be the best folder to locate rfm?

                          As you said you put it on your PC (so I assume Windows), to have it most easily working you need to add the directory you store rfm in into your PATH (I haven't used Windows in a decade so please bear with me if I cannot tell you how to do that on recent editions). On Windows there is (or at least was) no standard way of puting custom binaries anywhere so again this is left to you where to actually put the binary (sorry).

                          I'm assuming all the folders should be backed up, but does rfm process them all

                          rfm will simply backup everything recursively under the given remote path. In your case 0:/ will simply back yup every single file it can find on the SD card.

                          Is there a naming protocol for the backup files, or will they be overwritten every time they're backed up?

                          They will be overwritten continuously with each run. It will leave remotely removed files locally though unless you also pass the parameter -removeLocal.

                          Manuel
                          Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
                          with probably always latest firmware/DWC (incl. betas or self-compiled)
                          My Tool Collection

                          Nightowlundefined 2 Replies Last reply Reply Quote 2
                          • Nightowlundefined
                            Nightowl @wilriker
                            last edited by

                            Awesome, thank you @wilriker

                            You are completely forgiven.

                            The backup folder will actually be on a NAS (hopefully), but you've given me plenty to get on with.

                            Thanks again 👍

                            Few things are more dangerous than taking the advice of someone who thinks he knows what he's doing.
                            I'm still on my learning curve, so take everything I say with caution!

                            RatRig 1075, Duet3 MB6HC, Sorotec SFM 1000 PV-ER milling motor, Hobbyist

                            1 Reply Last reply Reply Quote 0
                            • Garth_42undefined
                              Garth_42 @wilriker
                              last edited by

                              @wilriker haha, thanks for the reply. This is good to know, I was creating an rclone script to do backup on the SBC. I saw this and my interest was piqued.

                              1 Reply Last reply Reply Quote 0
                              • Nightowlundefined
                                Nightowl @wilriker
                                last edited by

                                @wilriker
                                Sorry to have to keep asking silly questions, but i've tried to run RFM from the folder it's installed in, from the command line in Windows, and I get the error:

                                -domain is mandatory
                                

                                I've used both the IP address and domain name of the control board, i.e.:

                                rfm backup -device Weeble //Libraries/CNC File O:/
                                

                                and

                                rfm backup -device 192.168.1.121 //Libraries/CNC File O:/
                                

                                With the same result.

                                Have I missed something (else!) please?

                                Thank you

                                Few things are more dangerous than taking the advice of someone who thinks he knows what he's doing.
                                I'm still on my learning curve, so take everything I say with caution!

                                RatRig 1075, Duet3 MB6HC, Sorotec SFM 1000 PV-ER milling motor, Hobbyist

                                wilrikerundefined 1 Reply Last reply Reply Quote 0
                                • wilrikerundefined
                                  wilriker @Nightowl
                                  last edited by

                                  @Nightowl rfm uses two sources to get the parameters to connect to a device. For convenience means it will save connection settings (-domain as well as -port and -password) in a config file. By default it uses a device called default for that.

                                  You have to provide this information (only -domain is actually necessary, the other two can use the default value in 99% of the times) once and after that you can omit these because they are saved in the config file. So you need to call

                                  rfm backup -domain <network address of your duet> -device Weeble ...
                                  

                                  once to init the config file. After that you can omit -domain ... and just use -device Weeble - or unless you want to address multiple devices you can also omit the -device Weeble part and from the start and use the default device.

                                  After that it should work.

                                  Manuel
                                  Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
                                  with probably always latest firmware/DWC (incl. betas or self-compiled)
                                  My Tool Collection

                                  1 Reply Last reply Reply Quote 0
                                  • Phaedruxundefined Phaedrux referenced this topic
                                  • k3lagundefined
                                    k3lag
                                    last edited by

                                    I just discovered rfm, nice job.

                                    I am using it on a Mac running Ventura. I am finding that it won't resolve the host name of my railcore.

                                    If I use the IP address it works fine but if I use the name railcore.local it doesn't find it. railcore.local does work for a ping from the command line and from a browser.

                                    1 Reply Last reply Reply Quote 0
                                    • wilrikerundefined
                                      wilriker
                                      last edited by wilriker

                                      I just released rmf v1.2.0 yesterday.

                                      It contains a bug fix for the backup command when the amount of files in a directory on the SD card exceed the amount that can be returned by RRF in one single response - rfm used to go into an endless loop then.

                                      Besides that it was not possible to abort any operation by sending an interrupt signal (pressing CTRL+C on the console). I recommend everyone to update to the latest version.

                                      Manuel
                                      Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
                                      with probably always latest firmware/DWC (incl. betas or self-compiled)
                                      My Tool Collection

                                      Chrissundefined 1 Reply Last reply Reply Quote 2
                                      • deckingmanundefined deckingman referenced this topic
                                      • Phaedruxundefined Phaedrux referenced this topic
                                      • droftartsundefined droftarts referenced this topic
                                      • Chrissundefined Chriss referenced this topic
                                      • Chrissundefined
                                        Chriss @wilriker
                                        last edited by

                                        Hi @wilriker, thank you very much for that tool! I use it 3-4 times a day!

                                        I have a tiny feature request. 🙂 I would like to have one more switch:

                                        --version | -v 
                                        

                                        That would be very helpful. 🙂

                                        Cheers, Chriss

                                        1 Reply Last reply Reply Quote 0
                                        • Trietundefined
                                          Triet
                                          last edited by

                                          I am "necroposting" but this is supposed to be the place to put this question. rfm is still a thing, or not?

                                          rfm is intended to be used to copy/backup files on the SD card.

                                          Would it be possible to configure some File Transfer client software to use rfm as the underlying transfer method? Usually, those clients use some sort of FTP to do that. Of course, it is up to the client software to be so flexible to allow free customization of operations to get/put files, defining which external tool would be used and their options.

                                          Has anyone done that? This is to avoid using FTP (wobbly in my case).

                                          By the way, what is the network protocol used by rfm?

                                          wilrikerundefined 1 Reply Last reply Reply Quote 0
                                          • wilrikerundefined
                                            wilriker @Triet
                                            last edited by

                                            @Triet said in rfm - RepRapFirmware FileManager [duetbackup successor]:

                                            By the way, what is the network protocol used by rfm?

                                            rfm uses HTTP as the underlying communication protocol.

                                            Manuel
                                            Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
                                            with probably always latest firmware/DWC (incl. betas or self-compiled)
                                            My Tool Collection

                                            1 Reply Last reply Reply Quote 0
                                            • stuartofmtundefined stuartofmt referenced this topic
                                            • First post
                                              Last post
                                            Unless otherwise noted, all forum content is licensed under CC-BY-SA