You're almost there. Why don't you schedule it five minutes from now, give it a small subset to work on, and check the results. Then do some fine tuning...
Last edited by RudiC; 11-19-2015 at 05:29 PM..
Reason: "Then" wasn't right.
30 20 ** 2 tar –cz /home/user1 > /home/user1/backup.tar.gz
Is it alright ?
Sigh...
RudiC has told you two times now to separate the two asterisks by a space. The line as you present it is still wrong because of that and no matter what options to tar you try will change anything about that BECAUSE THIS IS NOT THE PROBLEM IN FIRST PLACE!
Try a layered approach: first, consult the man pages of cron and learn how to configure a (any) command to be run by cron. Only then concern yourself with constructing the correct tar-command: first manually. When it finally does what you want it to do put it into cron using your new-found expertise on creating cron-jobs.
So much as a starter: cron jobs have NOT the same environment as commands run from an interactive session, namely the PATH variable is empty and therefore you should use full pathnames. instead of tar <cmd> /some/path you need to write something like /usr/bin/tar <cmd> /some/path. Notice the full path to the command. Your path might differ, but you can easily get the (on your system) correct path with the which command:
ok so: 20 20 * * * sudo tar -cvpzf backup.tar.gz /home/user1
and backup will be in /root right ?
probably, maybe, ... i don't know. Most probably there will be no backup at all, just a mail to root about a command not found. Do i need to repeat what i said about using full pathes three times too before you take the suggestion into consideration as with the space between the asterisks?
The command will be executed every day at 20:20 but "sudo" will probably be not found at all, as well as "tar".
Hi All,
Is there is any way to find the size of compressed file without doing decompression. The size should give the original uncompressed data size
Thanks
Arun (3 Replies)
I need UNIX scripts for polling, Uncompressing files and moving files between directory. Also trying to save file paths and any other variables in an independent file (.env) and use these at runtime by executing this file in the main script. (3 Replies)
i have a file 4d7a94d0.bbb.1292
when i do
file 4d7a94d0.bbb.1292
the ouput is below
4d7a94d0.bbb.1292: gzip compressed data - deflate method
and i run this command
gunzip -c 4d7a94d0.bbb.1292 | awk '{gsub("\"","")}/I_ACCOUNT_ID/{print $2}' RS=":|;" FS=","
i get... (3 Replies)
Hello all
I want to help
I have some compressed files on the system
When you want to unzip these files
Delete any file which symlink
"ln -s"
{{
I need script is necessary
Script contain:
Any operation to decompress the system is doing to delete any symlink... (0 Replies)
Hi
i have a filename.tar.bz2 and i have to parse it with a tool that doesn't support compressed files.
I have to do it for many big files, so i can't decompress and then process. I'd like to do something like:
tar -jxvf namefile.tar.bz2 | parsing_tool
i mean analyze it directly,... (4 Replies)
Hi,
I have a file that has got compressed data. I would want to uncompress the packed decimal data(not the file). is there a way to do that in ksh? (6 Replies)
Are any of you guys aware of any problems when trying to sort compressed fields? Why I uncompress the file I am trying to sort, I have no problem sorting but when I try to sort compressed fields it doesnt work properly. I need to be able to sort these compressed fields. Any explanation why? (1 Reply)
Is there a way I can check if a file is comppressed or not? (Be it tar/gzip or compress). trying to write a generic housekeeping scrit that will delete files over 6 months old and compress any uncompressed files if less than 6 months old. But not sure if there is a clever way to check except for... (4 Replies)