ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I created a bash script that will tar all files inside a user's directory after 30 days but it seems not working. All my users has a directory named documents and inside that was a file. I want to backup all files inside their home directory and named it according to their usernam. If there is a user foo, the tar file should be foo.tar.gz
Is there a way I can modify this script to find the file from the month it was created? Example I want to find all files that was created last January 2009 and tar it. I think there will be no problem on tar. Problem could be in how to find files based on the month it was created.
Can find command has this option to do so? Any other command I can use?
well i m not quite sure , u need to do more search , but i think indoe structure don't contain creation time for a file , so simply there is nothing called creation time in linux.
although there is something confusing( for me ) in the inode called i think change indoe time , which sometimes confused with creation of the file , but it is not the creation time .
u have to change the logic of ur script , and not depend on teh creation date of files
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.