What's new

JFFS Usericon Copying for Backup / restore router

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

pgershon

Regular Contributor
How can I save the contents of all my /jffs/usericon? I have many symbolic links saved so I dont exceed the capacity of icons - many many of my icons are repeated. I have tried several ways but I am unable to move over the symbolic links.

I created hardlinks with ln ShellyNG.log B4B024551922.log (for example). When I do an ls of the directory, the files are shown in green and the hard links are shown in blue. But then when I try to copy, I either cannot copy the hard links or I copy the hard links as files too. Neither is preferable if I want to easily transfer the icons back to my newly reset router.

cp -r /jffs/usericon /tmp/mnt/NO_NAME fails: "cp: can't create symlink '/tmp/mnt/NO_NAME/usericon/B4B024B47AFA.log': Operation not permitted"
cp -aL /jffs/usericon /tmp/mnt/NO_NAME fails too because the hard linked files are copied and not as links. So I get too many icon for the directory when I restore.

Is there an easy way to do this?
 
Use symbolic links instead of hard links. You also need to copy them to a filesystem that supports symlinks, i.e. not FAT32. It would be better if you used tar to create a single archive file rather than using cp. Then you would be able to copy the archive file to any destination regardless of the filesystem type.
 
Last edited:
Thanks very much.

I misspoke to start. The links I created are symbolic links - "ln -s ShellyNG.log B4B024551922.log". You answered my question though - I was trying and failing to move the symbolic links to a FAT32 filesystem on my USB thumb drive. I figured out how to use TAR to create an archive: "/jffs/usericon# tar -cvf /tmp/mnt/data.tar /jffs/usericon". I then moved it to the USB drive and I have a copy on my MAC for future use.

When I want to restore the archive, what is the best way to do that? Will this format work? "tar -xvf /tmp/data.tar"?
 
When I want to restore the archive, what is the best way to do that? Will this format work? "tar -xvf /tmp/data.tar"?
You have to be careful about the current working directory when backing up and restoring files (see the warning that was output when you ran your backup command). So I prefer to explicitly define the directory in the tar command. That makes things more obvious, and simpler if you want to restore the files to a different location.

Code:
tar -C /jffs -cvf /tmp/backup.tar usericon
Code:
tar -C /jffs -xvf /tmp/backup.tar
 
Install rsync on the router. When copying files, rsync has the ability to preserve hard links with -H flag.
 
Install rsync on the router. When copying files, rsync has the ability to preserve hard links with -H flag.
The problem was that he was trying to copy the files to a filesystem that doesn't support hard or soft links (FAT32). rsync won't change that.
 
Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top