Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Hi there lovely community.
In the past (with your help) I have written a bash script that backs up my thesis and send it over email for remote backup.
I want to change the below line
tar -jcvf "$COMPRESSEDFILENAME" "$THESISFOLDER"
so it does not take all my thesis folder but only the
*.tex files and two subfolders and compresses them
to a single compressed file.
Reason is that these are the most important parts and that would keep the overallsize of the compressed file at reasonable size levels.
Can you help me tweak he above line?
Regards
Alex
Distribution: openSUSE(Leap and Tumbleweed) and a (not so) regularly changing third and fourth
Posts: 627
Rep:
You can also set up a text file listing the files and/or the directories to be zipped save it as , say, 'backup-in' and then your backup script would be something like
Code:
tar -czf your_backup_filename -T /path/to/backup-in
If it's easier to list the ones that don't go in do
Code:
tar -czf filename -X /path/to/backup-out
and create a text file (called backup-out, of course).
Distribution: openSUSE(Leap and Tumbleweed) and a (not so) regularly changing third and fourth
Posts: 627
Rep:
Quote:
Originally Posted by alaios
tar -jcvf "COMPRESSEDFILENAME_SHORT" "$THESISFOLDER/*.tex" "$THESISFOLDER/chapters" "$THESISFOLDER/appendices"
tar complains about the
"$THESISFOLDER/*.tex" -->No such file or directory.
What I want is to just grap the .tex files inside the folder
Try
Code:
...$THESISFOLDER"*.tex" ... etc
It also makes a difference how you set your thesis folder variable - you may be putting in 2 "/"'s.
And by the way, you may not have liked my text file approach, but just in case, my second choice code missed out the folder to backup and then the text file tells tar what to leave out.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.