What's new

auto-delete router usb disk (dsl-ac68u)

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

freebil

Occasional Visitor
Hello. I have an ip-camera which sends file via ftp on the router hard disk. Is there anything I can do to delete the older files once a week without opening any pc? Thanks.
 
If you are concerned with security/privacy, make sure to securely delete the files. This means overwriting the file with random data before deleting. A file that is only deleted can easily be recovered.

You could use a command like "dd if=/dev/urandom of=/video/file.mp4" a couple of times perhaps followed by "dd if=/dev/zero of=/video/file.mp4" before deleting.

This may not apply to a solid-state drive.
 
Thanks for the answers. I dont care about privacy. I want to keep files only for one week, so the disk is not full. I have the asus dsl-ac68u which not supports merlin firmware. Moreover, I have ssd. Could you please give me more details about cron job?
 
Thanks for the answers. I dont care about privacy. I want to keep files only for one week, so the disk is not full. I have the asus dsl-ac68u which not supports merlin firmware. Moreover, I have ssd. Could you please give me more details about cron job?

See this link for an easy command to delete the files....
http://www.howtogeek.com/howto/ubuntu/delete-files-older-than-x-days-on-linux/

I know Merlin uses cru to manage the cron jobs.....not sure if it's there on the OEM code. Try telnet'ing to the router and see if you get help text when you just enter cru as a command.
 
Thanks for the answer. I attach the cru command. Moreover, I typed cru l, which responds nothing.


Screen Shot 2015-03-04 at 12.32.28 AM.png
 
I know Merlin uses cru to manage the cron jobs.....not sure if it's there on the OEM code. Try telnet'ing to the router and see if you get help text when you just enter cru as a command.

I don't think Asus ever fixed their cru script, I think it's still hardcoded for "admin" rather than retrieving the correct uid 0 username from nvram. So long you don't change your login name, their script will work (but it won't survive a reboot).
 
Thanks for the answer. I tried to reboot with username admin but I did not succeed. If I understood correctly what you said, I changed username from "admin" to
"teo" but I did not succeed either.

Screen Shot 2015-03-04 at 12.54.00 AM.png
 
Thanks Merlin for the hint.....so you must keep your username as 'admin'

Try this command (replacing path/to/files* with your path). This will delete the files older than 7 days everyday at midnight.....

cru a DelOldCam "0 0 * * * find /path/to/files* -mtime +7 -exec rm {} \;"

And, as Merlin said, you'll need to re-enter the command whenever you reboot the router.
 
Another solution might be to use Putty (I'm pretty sure Putty can be configured to logon and send a command) and Windows Scheduler to execute the command on the router.
 
Thanks for the answers. I succeed to reboot with both usernames admin and teo.

Screen Shot 2015-03-04 at 1.26.32 AM.png



Screen Shot 2015-03-04 at 1.29.34 AM.png


I will try tommorow to delete the files. I use mac, not windows and I will leave my house for some months. So, I want to do this proccess without any pc opened. Thanks again.
 
Last edited:
Thanks for posting back.....now we know that ASUS fixed their OEM cru code......good luck getting things setup!
 
I searched the forum and I read some topics. Is it possible to format and mount jffs manually from telnet to be able to run scripts?

Screen Shot 2015-03-04 at 2.37.26 AM.png


and
Screen Shot 2015-03-04 at 2.46.13 AM.png



EDIT: I read this post http://www.snbforums.com/threads/scheduling-rebooting.11044/#post-68429 and after reboot in system log I see this
Code:
Mar  4 04:16:23 crond[620]: time disparity of 2193256 minutes detected
but when I type cru l in telnet I dont see anything.
Any thoughts?

EDIT2: The crond disparity time messages shows after every restart, so the script does not execute. I read many posts and I understand that the problem is to enable jffs partition. I ran dmesg after reboot :

Screen Shot 2015-03-04 at 1.38.30 PM.png

Screen Shot 2015-03-04 at 1.38.38 PM.png


How can I enable jffs partition?

EDIT3: After reading I think jffs partition is enabled and mounted, because I can find it and I can write to it some scripts. The question is, does the stock firmware call the functions init-start, wan-start and the others after reboot?
 
Last edited:

Similar threads

Sign Up For SNBForums Daily Digest

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