Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Cron job to delete all files/directories/subdirectories older than 1 day

Featured Replies

I would like to set up a cron job to delete all files and folders/directories older than 24 hours in my downloads directory.  I have made a few attempts to do this but cron is proving to be a bit tougher to understand than I previously expected.  I've tried a few versions of the following commands:


 

find /mnt/user/path/path/* -type d -mtime +0 -print0 -exec rm {} +

find /mnt/user/path/path/* -type f -mtime +7 -print0 | xargs -0 rm

find /mnt/user/path/path/* -mtime -1 -ls -exec rm -d {} +

find /mnt/user/path/path/* -mtime -1 -ls -exec rmdir -f {} +

 

I'm finding varying degrees of success, but essentially the downloads folder is broken into a few subdirectories.  I want to clean out those subdirectories of all files and folders older than 24 hours on a weekly scheduled job.  I have not been able to get this working the way I want.  I have run a combination of these scripts with some different options enabled, but I'm looking for one script to do what I need.  Does anyone have a better example of what I'm trying to accomplish?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.