File Deletion after x amount of time CentOS 7
-
@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.
-
@Dashrender 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
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.
We have docs that share data and that folder must be auto-cleaned. HIPAA.
-
@Dashrender 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
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.
And if she wanted it, she should be telling you to do it, not you asking if you can do it. No reason for IT to care or promote this outside of letting management know that it is an option or whatever.
-
@Grey said in How to Make a File Self Delete or Time Bomb:
@Dashrender 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
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.
We have docs that share data and that folder must be auto-cleaned. HIPAA.
And in a case like that, management and management alone would dictate that and make it something that IT has to do. IT would never be the banner carrier for a retention policy.
-
@scottalanmiller said in How to Make a File Self Delete or Time Bomb:
@Dashrender 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
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.
And if she wanted it, she should be telling you to do it, not you asking if you can do it. No reason for IT to care or promote this outside of letting management know that it is an option or whatever.
It was requested by upper management of the city. I know there are going to be a lot of tears and I'm here to say your tears taste so good users. So good.
-
@wirestyle22 said in File Deletion after x amount of time CentOS 7:
@scottalanmiller said in How to Make a File Self Delete or Time Bomb:
@Dashrender 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
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.
And if she wanted it, she should be telling you to do it, not you asking if you can do it. No reason for IT to care or promote this outside of letting management know that it is an option or whatever.
It was requested by upper management of the city. I know there are going to be a lot of tears and I'm here to say your tears taste so good users. So good.
Are up Cartman now?
Tears of unfathomable sorrow -Cartman to Scott Tenorman.