Crontab compressed version


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Crontab compressed version
# 8  
Old 11-18-2015
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.
# 9  
Old 11-19-2015
30 20 ** 2 tar –cz /home/user1 > /home/user1/backup.tar.gz
Is it alright ?
# 10  
Old 11-19-2015
Quote:
Originally Posted by zekeboy
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:

Code:
# which tar
/usr/bin/tar

I hope this helps.

bakunin
# 11  
Old 11-19-2015
ok so: 20 20 * * * sudo tar -cvpzf backup.tar.gz /home/user1

and backup will be in /root right ?
# 12  
Old 11-19-2015
Quote:
Originally Posted by zekeboy
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".

I hope this helps.

bakunin
# 13  
Old 11-19-2015
i got it, everything works ! thank you for your patience ! !
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Size of compressed file

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)
Discussion started by: arunkumar_mca
3 Replies

2. Shell Programming and Scripting

Copy a file from directroy/ prior version to the directory/ new version

How to copy a file from directroy/ prior version to the directory/ new version automatically. (4 Replies)
Discussion started by: roy1912
4 Replies

3. Shell Programming and Scripting

Execution of compressed program

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)
Discussion started by: new2script
3 Replies

4. Shell Programming and Scripting

compressed file

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)
Discussion started by: blackzinga80
3 Replies

5. Shell Programming and Scripting

scan compressed

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)
Discussion started by: x-zer0
0 Replies

6. Shell Programming and Scripting

Process a compressed file

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)
Discussion started by: Dedalus
4 Replies

7. Shell Programming and Scripting

Ucompress the compressed data

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)
Discussion started by: ahmedwaseem2000
6 Replies

8. UNIX for Dummies Questions & Answers

compressed file

I compressed a file by using gzip command gzip <<xx>> filename changed to xx.gz How to view this xx.gz file. Any idea. Thanks in advance. (7 Replies)
Discussion started by: venkatesht
7 Replies

9. UNIX for Dummies Questions & Answers

Sorting Compressed Fields

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)
Discussion started by: ndoggy020
1 Replies

10. Shell Programming and Scripting

Check if file compressed or not

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)
Discussion started by: badg3r
4 Replies
Login or Register to Ask a Question