Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )

Advanced DNS Management
New ZoneEdit. New Managment.


Sign Up Now
> Move script.
post Sep 2 2008, 06:03 PM
Post #1

Whats this Lie-nix Thing?

Group: Members
Posts: 8
Joined: 11-August 08
Member No.: 13,606

I have a program that makes png images in a folder, and ever 24 hours or so i want to move them to a new folder via cron job, how could this be done?
basicaly the format wants to be:

mkdir /home/test/*currect date*
mv -rf /home/test/*.png *current date (folder i just made)
cp -rf /home/orign/*.png /home/test

and i want it to basicaly do this process Every 24/7 via cron job.

Any one got any idea? i think i have the basics, but how would i get variable to make the folder as the current date? just by the server clock.
Go to the top of the page
+Quote Post
Start new topic
post Sep 2 2008, 07:24 PM
Post #2

Its GNU/

Group: Support Specialist
Posts: 1,807
Joined: 23-January 03
Member No.: 360

Something like
mkdir /home/test/`date +%y%m%d`

You can also create a variable like
DATE=/home/test/`date +%y%m%d`
and use it for all commands.

Look at the date man pages to change the format as desired.
Go to the top of the page
+Quote Post

Posts in this topic

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 23rd July 2018 - 06:50 AM