I know, i know... a step has been missed. And another step has been done twice.Spider99 wrote:and its running twice!
Just waiting on an answer to my last question before addressing that.
I know, i know... a step has been missed. And another step has been done twice.Spider99 wrote:and its running twice!
Yes I did run it as you directed....with no errorsOneCD wrote:Can you please advise as to whether you ran delete-old-stuff.sh successfully? I do need to know if it worked before moving forward.
I should have been clearer - what I meant is that after it ran, did you check that it had only deleted files and folders older than 11 days?sharper9 wrote:Yes I did run it as you directed....with no errorsOneCD wrote:Can you please advise as to whether you ran delete-old-stuff.sh successfully? I do need to know if it worked before moving forward.
No, you won't need to copy from nano. It's the editor.sharper9 wrote:Im having trouble copying the code from nano.
I keep getting spurious line at the bottom?
Code: Select all
nano /etc/config/crontab
# m h dom m dow cmd
0 3 * * 0 /etc/init.d/idmap.sh dump
0 4 * * * /sbin/hwclock -s
0 3 * * * /sbin/vs_refresh
0 3 * * * /sbin/clean_reset_pwd
0-59/15 * * * * /etc/init.d/nss2_dusg.sh
30 7 * * * /sbin/clean_upload_file
0 2 * * * /sbin/qfstrim
0-59/10 * * * * /etc/init.d/storage_usage.sh
30 3 * * * /sbin/notice_log_tool -v -R
31 * * * * /sbin/qddns_check 2>/dev/null
10 15 * * * /usr/bin/power_clean -c 2>/dev/null
10 0 * * * /etc/init.d/antivirus.sh scan 1
0 0 * * * /etc/init.d/antivirus.sh archive_log
08 0 */1 * * /etc/init.d/antivirus.sh update_db
* * * * * /mnt/ext/opt/netmgr/util/lock_timer.sh
35 7 * * * /sbin/qbox_util -c > /dev/null 2>/dev/null
4 3 * * 3 /etc/init.d/backup_conf.sh
0 1 * * * /share/50014EE20BA4E444_DATA/.system/delete-old-stuff.sh
Code: Select all
cat /etc/config/crontab
Code: Select all
crontab /etc/config/crontab
Code: Select all
/etc/init.d/crond.sh restart
Code: Select all
crontab -l
In that post, I asked whether you had edited the file. I didn't say to edit it again. I was quite literal.sharper9 wrote:The double entry was done about an hour ago in response to you post "Tue Mar 14, 2017 4:58 pm"
I doubled because I thought I had 'not' done it correctly. So I did it again this it was doubled.OneCD wrote:In that post, I asked whether you had edited the file. I didn't say to edit it again. I was quite literal.sharper9 wrote:The double entry was done about an hour ago in response to you post "Tue Mar 14, 2017 4:58 pm"
We are nearly there. You're doing fine.sharper9 wrote:I'll do this in the morning and post back.
I think we are 'nearly' there.
Question: how do you cut and paste from nano?OneCD wrote:We are nearly there. You're doing fine.sharper9 wrote:I'll do this in the morning and post back.
I think we are 'nearly' there.
'nano' is only the command line editor. For what we're doing here, it's not a good idea to copy and paste from the editor, as I won't know if what I'm seeing is really in the file you're editing.sharper9 wrote:Question: how do you cut and paste from nano?
So you can past it here like above?
OneCD wrote:Please post this screen back here along with the command you used to show this file (cat).
Code: Select all
[~] # cat /etc/config/crontab
# m h dom m dow cmd
0 3 * * 0 /etc/init.d/idmap.sh dump
0 4 * * * /sbin/hwclock -s
0 3 * * * /sbin/vs_refresh
0 3 * * * /sbin/clean_reset_pwd
0-59/15 * * * * /etc/init.d/nss2_dusg.sh
30 7 * * * /sbin/clean_upload_file
0 2 * * * /sbin/qfstrim
0-59/10 * * * * /etc/init.d/storage_usage.sh
30 3 * * * /sbin/notice_log_tool -v -R
31 * * * * /sbin/qddns_check 2>/dev/null
10 15 * * * /usr/bin/power_clean -c 2>/dev/null
10 0 * * * /etc/init.d/antivirus.sh scan 1
0 0 * * * /etc/init.d/antivirus.sh archive_log
08 0 */1 * * /etc/init.d/antivirus.sh update_db
* * * * * /mnt/ext/opt/netmgr/util/lock_timer.sh
35 7 * * * /sbin/qbox_util -c > /dev/null 2>/dev/null
0 1 * * * /share/50014EE20BA4E444_DATA/.system/delete-old-stuff.sh
OneCD wrote:Please post this screen back here along with the command you used to show this file (crontab).
Code: Select all
[~] # crontab -l
# m h dom m dow cmd
0 3 * * 0 /etc/init.d/idmap.sh dump
0 4 * * * /sbin/hwclock -s
0 3 * * * /sbin/vs_refresh
0 3 * * * /sbin/clean_reset_pwd
0-59/15 * * * * /etc/init.d/nss2_dusg.sh
30 7 * * * /sbin/clean_upload_file
0 2 * * * /sbin/qfstrim
0-59/10 * * * * /etc/init.d/storage_usage.sh
30 3 * * * /sbin/notice_log_tool -v -R
31 * * * * /sbin/qddns_check 2>/dev/null
10 15 * * * /usr/bin/power_clean -c 2>/dev/null
10 0 * * * /etc/init.d/antivirus.sh scan 1
0 0 * * * /etc/init.d/antivirus.sh archive_log
08 0 */1 * * /etc/init.d/antivirus.sh update_db
* * * * * /mnt/ext/opt/netmgr/util/lock_timer.sh
35 7 * * * /sbin/qbox_util -c > /dev/null 2>/dev/null
0 1 * * * /share/50014EE20BA4E444_DATA/.system/delete-old-stuff.sh
Many many thanks, you are a star!OneCD wrote:And ... you're done!
Your crontab looks great. All that's left to do is monitor that USB drive and periodically check that those files are being deleted. You can add further paths to the bottom of delete-old-stuff.sh as needed.
If you have any further questions, or are unsure as to how to alter the schedule, please post back and I'd be happy to assist.
Looks good. That should run it at 11am, each day.sharper9 wrote:Sadly it does not look like its deleted the files
I changed the crontab to fire @ 11 (see below).
That's OK. The order can be changed by the NAS - it edits this file too.sharper9 wrote:Then once again I noticed the last SOB! line keeps appearing.
To run the script manually:sharper9 wrote:What, in my clumsy way, I was trying to achieve was to test/run the delete job. I failed!
Code: Select all
/share/50014EE20BA4E444_DATA/.system/delete-old-stuff.sh
Code: Select all
/share/50014EE20BA4E444_DATA/.system/delete-old-stuff.sh