Sponsored Content
Full Discussion: Tarring problem.
Top Forums Shell Programming and Scripting Tarring problem. Post 302556179 by Nagaraja Akkiva on Saturday 17th of September 2011 03:11:03 AM
Old 09-17-2011
Tarring problem.

We execute script to tarr files as normal user. Normal user doesn't have permission to append file to existing tarr file, since tarr files are owned by root user.

Even though script is creating tar file and is executed by normal user, It shows that tar file is created by root. I ran script for the date range 13-SEP-2011 and 14-SEP-2011. File tarring listed all files for the date 13-SEP-2011 first and tarred it and listed all the files belongs to 14-SEP-2011 then it tried to append these files to existing tarr file since both dates belong to the same week.Since normal user did not has enough permission to change the permission of the tarr file. Hence error occurred.

Example: Say, there are three files present in test directory namely a.txt, b.txt, c.txt and all are owned by root and belons to different week.
tar cvf TarFilename a.txt --> Working as expected.
The above script creates tarr file which is owned by root. since tarr fie retains propreties of file got tarred.
chmod 777 TarFilename
tar -rf TarFilename b.txt --> Failing since normal user does not has the permission to change the permission of tarr file.

We have two options now.
1. Change the owner of the directory where files need to be tarred.
2. Change the owner of the files(a.txt,b.txt etc) before sending it to our database.

Is there any way that we can achive this apart from above cases. please let me know.

Please let me know if need any details.

Thanks and Regards
Nagaraja

Last edited by Nagaraja Akkiva; 09-19-2011 at 08:35 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

backup : files being modified while tarring

I would like to back up several directories weekly using a cronjob. I'm not experienced in UNIX, but I would start like this: tar -cvf backup.tar dir1 dir2 dir3 Now if a file is being modified in the process it will result in an error. How can I prevent this from happening and how can I... (5 Replies)
Discussion started by: jamesbond
5 Replies

2. UNIX for Dummies Questions & Answers

tarring and gzipping dump files

Say I want to transfer several dump files from a Solaris machine onto a Win2k machine for storage. It was suggested that I tar and gzip the dump files before doing so. Is it completely necessary to use both of these utilities, or is it sufficient to compress multiple dump files into one gzip... (4 Replies)
Discussion started by: PSC
4 Replies

3. UNIX for Dummies Questions & Answers

tarring large no. of files

dears, I have a folder containing huge no. of files, some of them are created on AUG 16, AUG 17 and AUG 18, for example. All I want to do is tarring all the files created on a certain date, say AUG 18, in one tar file, only in one command line. So, how to feed all the files created on a certain... (4 Replies)
Discussion started by: marwan
4 Replies

4. Shell Programming and Scripting

tarring/compressing files in Unix directory

hi guys, i'm totally new with Unix sripting and no idea how to do the scripting at all. My problem is that my boss asked me to do this: 1.) create a script that will tar or gzip the files in particular directory eg: i'm on my home directory and I need to tar/gzip the file in.. assuming... (1 Reply)
Discussion started by: montski
1 Replies

5. AIX

user login problem & Files listing problem.

1) when user login to the server the session got colosed. How will resolve? 2) While firing the command ls -l we are not able to see the any files in the director. but over all view the file system using the command df -g it is showing 91% used. what will be the problem? Thanks in advance. (1 Reply)
Discussion started by: pernasivam
1 Replies

6. Shell Programming and Scripting

Bash Tarring not un Tarring correctly

HI All, Im encountering behaviour that is not correct for my requirements when I untar a file. Im using the below command to tar up files from various folders to the ARCHIVE folder as below... tar -cvf "$ARCHIVE_PATH"/"$dte_tar_filename" "$LOG_PATH" "$PROCESSED_PATH2" "$ERROR_PATH" ... (5 Replies)
Discussion started by: satnamx
5 Replies

7. IP Networking

Problem with forwarding emails (SPF problem)

Hi, This is rather a question from a "user" than from a sys admin, but I think this forum is apropriate for the question. I have an adress with automatic email forwarding and for some senders (two hietherto), emails are bouncing. This has really created a lot of problems those two time so I... (0 Replies)
Discussion started by: carwe
0 Replies

8. UNIX for Dummies Questions & Answers

Tarring files up to four days old

Hi I need help in tarring files up to four days old. I have been doing this: find . -mtime -4|xargs tar -cvf mar4.tar However, it seems like it's tarring everything but leaving those that are 4 days old and newer (which I want tarred and everything else not) ---------- Post updated at... (1 Reply)
Discussion started by: MIA651
1 Replies

9. UNIX for Dummies Questions & Answers

sed Or Grep Problem OR Terminal Problem?

I don't know if you guys get this problem sometimes at Terminal but I had been having this problem since yesterday :( Maybe I overdid the Terminal. Even the codes that used to work doesn't work anymore. Here is what 's happening: * I wanted to remove lines containing digits so I used this... (25 Replies)
Discussion started by: Nexeu
25 Replies

10. HP-UX

Tarring files to remote server

Hi, I need to tar some files in a directory to a remote server. I need to exclude some file from this directory and then tar it over. This is the command suggested by one article (tarring in the same server) : tar -zcvf /tmp/mybackup.tar.gz -X exclude.txt /home/me However it does not... (9 Replies)
Discussion started by: anaigini45
9 Replies
CURLOPT_COOKIELIST(3)					     curl_easy_setopt options					     CURLOPT_COOKIELIST(3)

NAME
CURLOPT_COOKIELIST - add to or manipulate cookies held in memory SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_COOKIELIST, char *cookie); DESCRIPTION
Pass a char * to a cookie string. Such a cookie can be either a single line in Netscape / Mozilla format or just regular HTTP-style header (Set-Cookie: ...) format. This will also enable the cookie engine. This adds that single cookie to the internal cookie store. Exercise caution if you are using this option and multiple transfers may occur. If you use the Set-Cookie format and don't specify a domain then the cookie is sent for any domain (even after redirects are followed) and cannot be modified by a server-set cookie. If a server sets a cookie of the same name (or maybe you've imported one) then both will be sent on a future transfer to that server, likely not what you intended. To address these issues set a domain in Set-Cookie (doing that will include sub-domains) or use the Netscape format as shown in EXAMPLE. Additionally, there are commands available that perform actions if you pass in these exact strings: ALL erases all cookies held in memory SESS erases all session cookies held in memory FLUSH writes all known cookies to the file specified by CURLOPT_COOKIEJAR(3) RELOAD loads all cookies from the files specified by CURLOPT_COOKIEFILE(3) DEFAULT
NULL PROTOCOLS
HTTP EXAMPLE
/* This example shows an inline import of a cookie in Netscape format. You can set the cookie as HttpOnly to prevent XSS attacks by prepending #HttpOnly_ to the hostname. That may be useful if the cookie will later be imported by a browser. */ #define SEP " " /* Tab separates the fields */ char *my_cookie = "example.com" /* Hostname */ SEP "FALSE" /* Include subdomains */ SEP "/" /* Path */ SEP "FALSE" /* Secure */ SEP "0" /* Expiry in epoch time format. 0 == Session */ SEP "foo" /* Name */ SEP "bar"; /* Value */ /* my_cookie is imported immediately via CURLOPT_COOKIELIST. */ curl_easy_setopt(curl, CURLOPT_COOKIELIST, my_cookie); /* The list of cookies in cookies.txt will not be imported until right before a transfer is performed. Cookies in the list that have the same hostname, path and name as in my_cookie are skipped. That is because libcurl has already imported my_cookie and it's considered a "live" cookie. A live cookie won't be replaced by one read from a file. */ curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "cookies.txt"); /* import */ /* Cookies are exported after curl_easy_cleanup is called. The server may have added, deleted or modified cookies by then. The cookies that were skipped on import are not exported. */ curl_easy_setopt(curl, CURLOPT_COOKIEJAR, "cookies.txt"); /* export */ curl_easy_perform(curl); /* cookies imported from cookies.txt */ curl_easy_cleanup(curl); /* cookies exported to cookies.txt */ AVAILABILITY
ALL was added in 7.14.1 SESS was added in 7.15.4 FLUSH was added in 7.17.1 RELOAD was added in 7.39.0 RETURN VALUE
Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space. SEE ALSO
CURLOPT_COOKIEFILE(3), CURLOPT_COOKIEJAR(3), CURLOPT_COOKIE(3), CURLINFO_COOKIELIST(3), libcurl 7.54.0 April 26, 2016 CURLOPT_COOKIELIST(3)
All times are GMT -4. The time now is 07:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy