Results 1 to 5 of 5

Thread: Linux help!

  1. #1
    Senior Member chujai's Avatar
    Join Date
    Nov 2006
    Posts
    152

    Linux help!

    i remember reading someone else's post on linux and seem to be a lot of people who know their stuff here so ill try here..

    its my assignment for school...
    set up a cron job for root that creates an archive of the home directory of the user arnold as well as all files in /var belonging to arnold. the archive has to be created at the end of the month early in the morning (between 12:00 am to 5:00am) store the archive in /var/local/backup. Give the archive a descriptive filename and include the month as part of the filename. such as arnold-Jan.tar. everytime the archive is created log the action to a seperate log file named /var/log/user.

    the action has to be accomplished using a single job entry.

    OK thats the whole problem. so understand i need to do a tar.

    first part
    tar -cvf arnold-*month*.tar /home/arnold /var

    now *month* how do i put variable in there so that it uses the month of backup?
    also how do i seperate which files belong to arnold so it only archives files belonging to arnold?

    scheduling the cron job i konw how to do.

    any help would be great. thanks

  2. #2
    Senior Member groupie02's Avatar
    Join Date
    Sep 2006
    Posts
    255
    This should help you: man date
    Also, you should re-read the question as your solution is missing some key elements.

    Good luck with the assignment.
    65g - 80lbs LR - 4x36" 39W T5 HOs (2x10000K,2xActinics) - CSS125 - 25g sump - Mag 7 return - Blueline SD-1100 Closed Loop with OM Squirt * 2x Amphiprion ocellaris - 1x Paracanthurus hepatus - 1x Zebrasoma flavescens
    29g - with stuff ;-)
    Coming Soon - 120g with more stuff

  3. #3
    Senior Member chujai's Avatar
    Join Date
    Nov 2006
    Posts
    152
    hahah man date..

    i maned everything i can.. but yes figured out the date part.

    date +%b gave me the month. i just had to add it with the `date +%b`

    im still stumped on how to tar files in /var that belongs to arnold only.

    im playing around and starting it with: tar -cvf and then different options like owner but that only changes the tar to new owner...

  4. #4
    Senior Member pwall's Avatar
    Join Date
    Nov 2004
    Posts
    2,326
    You could use the 'find' command to find all files belonging to the user and pipe the output to tar.
    Regards,
    Patrick.
    Ottawa (Orleans), Ontario
    Yahoo IM: pwallnfld

  5. #5
    Senior Member chujai's Avatar
    Join Date
    Nov 2006
    Posts
    152
    true! good idea.... i was man tar the whole time thinking it was a built in function... thanks!

Similar Threads

  1. Off-topic: Linux/Samba config issue
    By pwall in forum Off Topic
    Replies: 25
    Last Post: 12-11-2006, 12:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •