find /etc/backup -mtime -1 -type f -print | tar -cvf backup.tar
i think it will grab all the files in my backup folder that are a day old and tar them together.
The above command will not do what you want:
-mtime -1 => modified files within 1 day, so only the last 24 hours
-mtime +1 => older then 1 day
tar will complain because the pipe will not work. The following example does work. The shell executes the find statement first and replaces everything within, and including the ` (backquotes) with the result of the find statement. I also changed the -1 to +1
tar cvf backup.tar `find /etc/backup -mtime +1 -type f -print`
find /etc -mtime -1 -type f -print | tar -cvf backup.tar
will it ONLY grab day old stuff in all the directories under /etc (ex: /etc/junk/test/.....) and tar them up in the correct file structure?
All files in /etc and all the subdirs.
If you want to limit the descend you can use -maxdepth, -mindepth and -depth (see manpage).