File Deletion after x amount of time CentOS 7
-
@scottalanmiller CentOS 7
-
From the file level its self, likely not.
-
cron rm
-
@wirestyle22 said in How to Make a File Self Delete or Time Bomb:
@scottalanmiller CentOS 7
Would not have guessed that at all! Normally with no other info we assume Windows. CentOS makes it easy.
-
@Grey said in How to Make a File Self Delete or Time Bomb:
cron rm
Yeah but you'd have to be careful
-
@Grey said in How to Make a File Self Delete or Time Bomb:
cron rm
Yup, that's how you do it. Make a cron job to check whatever file(s) or folder(s) you want and delete whatever matches the criteria at whatever age you desire.
-
@DustinB3403 said in How to Make a File Self Delete or Time Bomb:
@Grey said in How to Make a File Self Delete or Time Bomb:
cron rm
Yeah but you'd have to be careful
This is not a time crunch situation so I have as much time as I want to test it thoroughly
-
@DustinB3403 said in How to Make a File Self Delete or Time Bomb:
@Grey said in How to Make a File Self Delete or Time Bomb:
cron rm
Yeah but you'd have to be careful
rm -rf /
-
Hm. I'm going to try to get my auto-renew setup for certbot/letsencrypt through cron and then I guess I'll try to crack this. Good to know it's possible.
-
find /path/to/files -mtime +5 -exec rm {} ;*
That line would delete files older than the specified number of days. -
@Grey said in How to Make a File Self Delete or Time Bomb:
find /path/to/files -mtime +5 -exec rm {} ;*
That line would delete files older than the specified number of days.Very helpful. Thank you.
-
@wirestyle22 said in How to Make a File Self Delete or Time Bomb:
@Grey said in How to Make a File Self Delete or Time Bomb:
find /path/to/files -mtime +5 -exec rm {} ;*
That line would delete files older than the specified number of days.Very helpful. Thank you.
No worries. Had to mine my twitter account to find it.
-
Our users have no idea how to maintain a file server or use things for their intended purpose so I want to establish a policy immediately when this thing goes live so if their files are deleted it's their own problem
-
@wirestyle22 said in How to Make a File Self Delete or Time Bomb:
Our users have no idea how to maintain a file server or use things for their intended purpose so I want to establish a policy immediately when this thing goes live so if their files are deleted it's their own problem
Here's how to do the same thing in powershell: http://www.networknet.nl/apps/wp/published/powershell-delete-files-older-than-x-days
-
@wirestyle22 said in How to Make a File Self Delete or Time Bomb:
Our users have no idea how to maintain a file server or use things for their intended purpose so I want to establish a policy immediately when this thing goes live so if their files are deleted it's their own problem
You could, instead. secretly archive the files and store them someplace offline so that they THINK that they deleted them.
-
@scottalanmiller said in How to Make a File Self Delete or Time Bomb:
@wirestyle22 said in How to Make a File Self Delete or Time Bomb:
Our users have no idea how to maintain a file server or use things for their intended purpose so I want to establish a policy immediately when this thing goes live so if their files are deleted it's their own problem
You could, instead. secretly archive the files and store them someplace offline so that they THINK that they deleted them.
I see you're a graduate from the Hillary Clinton School of Technology.
-
@scottalanmiller said in How to Make a File Self Delete or Time Bomb:
@wirestyle22 said in How to Make a File Self Delete or Time Bomb:
Our users have no idea how to maintain a file server or use things for their intended purpose so I want to establish a policy immediately when this thing goes live so if their files are deleted it's their own problem
You could, instead. secretly archive the files and store them someplace offline so that they THINK that they deleted them.
-
@wirestyle22 said in How to Make a File Self Delete or Time Bomb:
@scottalanmiller said in How to Make a File Self Delete or Time Bomb:
@wirestyle22 said in How to Make a File Self Delete or Time Bomb:
Our users have no idea how to maintain a file server or use things for their intended purpose so I want to establish a policy immediately when this thing goes live so if their files are deleted it's their own problem
You could, instead. secretly archive the files and store them someplace offline so that they THINK that they deleted them.
Just be aware, if YOU delete files and something important is lost and you aren't 100% clear that there is a policy for this protecting you from management telling YOU that you can delete files, you could be on the hook legally. I would never do this unless told to, in writing, explicitly by management.
-
Even if there is a policy that the users are supposed to clean up files, unless there is also a policy that says that IT is tasked to enforce this through forced deletion, I would stay away from this completely. There is a huge different between "users are supposed to clean things up" and "IT has decided to start deleting things." Never take enforcement into your own hands.
-
@wirestyle22 said in How to Make a File Self Delete or Time Bomb:
Our users have no idea how to maintain a file server or use things for their intended purpose so I want to establish a policy immediately when this thing goes live so if their files are deleted it's their own problem
Good luck getting this by management. My boss would never allow something that auto deletes something after not being touched for some period of time.
Perhaps she would allow some type of auto archive that the user would then have to contact IT to get it back, but auto delete - never.