What's new

Custom firmware build for R7800 v. 1.0.2.63SF

  • 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!

You have more than one USB device mounted, or have had since boot, since you run commands from sdb1 instead of sda1.
(Or you change command to use sdb1)

Or use the volume name, which should always be the same.

EDIT: Voxel's scripts use /tmp/mnt/$1 instead.
 
You have more than one USB device mounted, or have had since boot, since you run commands from sdb1 instead of sda1.
(Or you change command to use sdb1)
Work, but

root@R7800:~$ /mnt/sda1/router_backup.sh
tar: Removing leading `/' from member names
tar: Removing leading `/' from hard link targets
tar: /etc/dnscrypt.conf: Cannot stat: No such file or directory
tar: /etc/netwall*.conf: Cannot stat: No such file or directory
tar: /opt/scripts/firewall-*start.sh: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors

Do I just remove these from script?
 
Work, but

root@R7800:~$ /mnt/sda1/router_backup.sh
tar: Removing leading `/' from member names
tar: Removing leading `/' from hard link targets
tar: /etc/dnscrypt.conf: Cannot stat: No such file or directory
tar: /etc/netwall*.conf: Cannot stat: No such file or directory
tar: /opt/scripts/firewall-*start.sh: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors

Do I just remove these from script?

Is there a chance the script is in DOS format instead of Unix?
 
dos2unix script.sh

Check the size before and after. If it's smaller after you run that command, it was probably in DOS format.

After that:

root@R7800:~$ dos2unix /mnt/sda1/router_backup.sh
root@R7800:~$ /mnt/sda1/router_backup.sh
-ash: /mnt/sda1/router_backup.sh: Permission denied
 
chmod a+x /mnt/sda1/router_backup.sh

root@R7800:~$ chmod a+x /mnt/sda1/router_backup.sh
root@R7800:~$ /mnt/sda1/router_backup.sh
tar: Removing leading `/' from member names
tar: Removing leading `/' from hard link targets
tar: /etc/dnscrypt.conf: Cannot stat: No such file or directory
tar: /etc/netwall*.conf: Cannot stat: No such file or directory
tar: /opt/scripts/firewall-*start.sh: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors
 
root@R7800:~$ chmod a+x /mnt/sda1/router_backup.sh
root@R7800:~$ /mnt/sda1/router_backup.sh
tar: Removing leading `/' from member names
tar: Removing leading `/' from hard link targets
tar: /etc/dnscrypt.conf: Cannot stat: No such file or directory
tar: /etc/netwall*.conf: Cannot stat: No such file or directory
tar: /opt/scripts/firewall-*start.sh: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors

Add the P switch for tar to allow absolute names. The rest of these files don't exist on mine, so maybe the paths are wrong?
 
Add the P switch for tar to allow absolute names. The rest of these files don't exist on mine, so maybe the paths are wrong?

The script:

Code:
#!/bin/sh
#----------------------------------------------------------------------
# router_backup.sh
#----------------------------------------------------------------------
BACKUPFILE=/mnt/sda1/R7800backup.tar.gz
BUP="\
/etc/profile
/etc/rc.local
/etc/dropbear
/etc/init.d/stubby
/etc/dnscrypt.conf
/etc/dnscrypt-proxy-2.toml
/etc/openvpn/config/client
/etc/dnsmasq.conf
/etc/*hosts
/etc/netwall*.conf
/opt/scripts/firewall-*start.sh
/root/.ssh/authorized_keys
"
cd /
X=$(echo "$BUP" | xargs)
tar -czhf ./${BACKUPFILE} ${X}
sync
 
The script:

Yes, what I'm telling you is that you need to add the P switch to the tar command:

Code:
tar -czhPf ./${BACKUPFILE} ${X}

and the errors where it cannot find the files to backup are probably because the file doesn't exist.
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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