What's new

Scheduled task for RT-AC3200 - How to do it?

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

João Paulo

New Around Here
Hello. First of all, sorry for my bad english.

I have a USB HDD conected to my ASUS RT-AC3200 router. FTP server is enabled in the router. I have an IP camera recording via FTP. The camera software lacks the option to delete older than 30 days recordings and my USB HDD is filling up quickly.

How can I schedule my router, once a day, to delete older than 30 days files from a specific directory in that USB HDD?

This is the directory: ftp://192.168.1.1/Seagate_Expansion_Drive/ALPHAVILLE_CAM1/FI9805W_00626E4CD600/record/

Router's ip is 192.168.1.1
Router's login name is "admin"

Right now I have the stock asus firmware 3.0.0.4.382_50624 but I can update to Merlin's if it is needed to do this job. I don't know very much about the language, the scripts required. I can update the firmware if needed, I can enable the jffs partition, access the router via telnet with putty, but I would need detailed instructions on the script itself. I would also like the script to work even when the router is restarted.

Is this possible?

Thank you,
João Paulo
 
You would probably need to install Merlin's firmware and then create 2 user scripts.

https://github.com/RMerl/asuswrt-merlin/wiki/User-scripts


/jffs/scripts/services-start
Code:
#!/bin/sh

/usr/sbin/cru a DeleteFiles "30 06 * * * /jffs/scripts/delete-files.sh"


/jffs/scripts/delete-files.sh
Code:
#!/bin/sh

DIR="/tmp/mnt/Seagate_Expansion_Drive/ALPHAVILLE_CAM1/FI9805W_00626E4CD600/record"

if [ -d $DIR ]
then
        find $DIR -mtime +30 -exec rm {} \;
fi

This will run the script at 06:30 every day and delete all files older than 30 days.
 

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!

Staff online

Top