Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 3 of 3

This is a discussion on Cron - Dummy Question in the Shared & Semi-Dedicated forum
Hey Guys... I am COMPLETELY clueless when it comes to writing a script to execute with a Cron job and need a bit of help... ...

  1. #1
    I didn't do it! Daniel_DBS's Avatar
    Join Date
    Aug 2007
    Location
    Mars
    Posts
    1,204

    Cron - Dummy Question

    Hey Guys...

    I am COMPLETELY clueless when it comes to writing a script to execute with a Cron job and need a bit of help...

    Now this will NOT be for my VPS but rather a shared account I have here at Jag as well...

    What I need to do is write a script, that I can setup a cron for, that will rename the folder named 'daily' to the current date...

    If you haven't figured it out, this is part of my backup routine. Nightly I use WHM to send backups to a shared account here at jag, which once per week I also take a backup of the backups and download them locally. blah blah...

    Like I said, I am completely STUPID when it comes to doing this crap...

    SOOOO HELP!!!!

    -Daniel

    If the automobile had followed the same development cycle as the computer, a Rolls-Royce today would cost $100, get a million miles to the gallon, and explode once every few weeks.

    My scripts never have bugs. They just develop random features.

  2. #2
    JPC Support Smithjp's Avatar
    Join Date
    Jun 2006
    Location
    Planet Earth
    Posts
    166
    Assuming that the daily folder is at /home/USERNAME/daily just put the following code in /home/USERNAME/rotate.sh.

    #!/bin/bash

    cd /home/USERNAME/
    mv daily `date +%F`


    It will format the folder as yyyy-mm-dd.Then all you need to do is setup a cron as:

    sh /home/USERNAME/rotate.sh

  3. #3
    I didn't do it! Daniel_DBS's Avatar
    Join Date
    Aug 2007
    Location
    Mars
    Posts
    1,204
    Thanks Smith!

    Like I always say, it's the easiest things that stump me!
    -Daniel

    If the automobile had followed the same development cycle as the computer, a Rolls-Royce today would cost $100, get a million miles to the gallon, and explode once every few weeks.

    My scripts never have bugs. They just develop random features.

Bookmarks

Posting Permissions

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