Moving file from one location to other in shell script

HI All,
I am facing one problem in moving file from one location to another location please help me out.
My code is as below :
mv ${file}.log ${DATA_XXX}/../archive/${file}.log_`date +"%m%d%y%H%M%S"`
mv ${file} ${DATA_XXX}/../archive/'abc'.`date +"%m%d%y%H%M%S"`
where file =test1 and DATA_XXX= "k01/aa/in"
please help me on this
Thanks

Please describe the problem. Perhaps you are missing the / i.e. /${DATA_XXX}

Similar Messages

  • How to copy file from  one location to another

    Hi,
    I am new to java, I tried the following code to move the file from one location to another
    public class CopyFiles {
    public String copy ( File source, File target)
    throws IOException {   
    FileChannel sourceChannel = null;
    FileChannel targetChannel =null;
    try {   
    sourceChannel =new FileInputStream(source).getChannel();
    targetChannel= new FileOutputStream(target).getChannel();
    targetChannel.transferFrom(sourceChannel, 0,
    sourceChannel.size());
    finally {   
    targetChannel.close();
    sourceChannel.close();
    return "Success";
    public static void main(String [] args) throws Exception{   
    File source = new File("C:\\users\\download.pdf");
    File destinationFile = new File("C:\\apple\\download.pdf");
    copy(source, destinationFile);
    The above code is working perfectly, but I Don't want to include the file name in destination file. i.e. File destinationFile=new File("C:\\apple"), and at the same time the pdf with same name has to get stored in the destination location, how can I achieve this.

    kameshb wrote:
    I Don't want to include the file name in destination file. i.e. File destinationFile=new File("C:\\apple"), and at the same time the pdf with same name has to get stored in the destination location, how can I achieve this.It's not totally clear what you're saying here, but what I think you mean is that you don't want to explicitly set the destination file name--you want to just give the copy the same name as the original. Yes?
    If that's the case, then break the original up into separate directory and file name portions, and then construct the destination path from the destination directory plus original file name. You can do that by manipulating the full path string, or by using the methods in java.io.File.

  • Copy File from One Location to Another Location through xcopy or any

    Hi,
    I Need to copy one file from one location to another location. That file need to save in C:\Windows\System32 folder
    I need to create one .bat file and i want apply that bat as a startup script through GPO.
    I tried through XCopy if i test in machine that is working. If i tried in other machine that is not working. becoz of some Credential issue
    I tried in the script by netuse command after that my script itself not working.
    SET username=XYZ\Administrator
    SET password=abcd
    @ECHO OFF
    cmd "cd C:\"
    net use "\\10.50.5.68\c$\Windows\System32" %password% /user:domain\%username%
    :copy
    Xcopy /S /I /E D:\DLL \\10.50.5.68\c$\Windows\System32 
    Regards, Hari Prasad.D

    You cannot do that in a startup script.  You do not need to do that in a startup script.
    To add files to the system use GP Preferences.
    On Window 7 and later only the Trussted Installer is allowed to add files. (That means only Microsoft.)
    No programs or users should ever alter files in the system area.
    ¯\_(ツ)_/¯

  • I need to upload my files from one directory into other directory.

    i need to upload my files from one directory into other directory.( all its contents,folders,sub folders, files etc)
    for this task
    suppose my source folder is C:/test/test1/test2/test3
    and my destination is D:/
    first i have to check whether my dest dirctory already contains source directory..and its files
    if it contains the same structure then i have to replace the destination dir structure to source dir structure( to upadte changes)
    if it(dest dir) not contains source dir ..means it doesn't contain source folder then
    i have to create same source folder directory structure ( test.test1/test2/test3...) at destination(D:/) and copy all its contents frm source directory...
    ( means i don;t want to create manually same dir structure as source at destnation dir to copy all contents)

    I believe you need to read up on the class File.java (it comes with java).
    Some examples:
    File file = new File("C:/myDirectory");
    if(file.isDirectory())
    System.out.println("this is a directory");
    if(file.isFile())
    System.out.println("this is a file").
    You will then need to read up on other classes to read/write to the file such as FileReader and FileWriter.

  • TROUBLE MOVING CONTACTS FROM ONE GROUP , TO OTHER (APPLE ADDRESS BOOK) WHEN I TRY TO DRAG IT WON'T STAY . WHERE SHOULD I BE , AND HOW DO I DRAG ???? AND RELEASE

    TROUBLE MOVING CONTACTS FROM ONE GROUP , , TO OTHER (APPLE ADDRESS BOOK) WHEN I TRY TO DRAG IT WON'T STAY . WHERE SHOULD I BE , AND HOW DO I DRAG ???? AND RELEASE   AB

    I have many different mailaccounts and different groups of contacts on my ipad and iphone. Sometimes i made the mistake when i create a new account linking it with the standard account. How it is possible to move one account to an other group?

  • How to copy a file from one location to another ???

    Hi,
    I have a file ('D:/Pictures/1.jpg') and I want to copy this 1.jpg file to a location called 'D:/Folder1'. I tried the WebUtil_File.copy_file function, but it does not work. it returns false boolean.
    I am using windows xp and oracle 10g.
    The webutil configurations are also completed.
    This D: drive is the one which has oracle 10g application server installed.
    Am I doing anything wrong or missed?. I need to complete this urgently. but it does not work.
    Or any other way to copy a file from one place to given any path?. After this I have to renaming (may be using Rename_File function) the copied file. Please advice me.

    An alternative could be HOST command, that calls OS prompt to run a command in the server and then return the focus to the Forms:
    HOST ('copy D:/Pictures/1.jpg D:/Folder1/1.jpg');
    Edited by: Kleber M on Sep 9, 2011 12:38 PM

  • Moving files from one drive to another

    How can I move a batch of files from one drive to another using Bridge CS4?

    There are two methods.  One involves your operating system and the other uses Bridge.
    Using Microsoft (sorry to you Mac users) have Windows Explorer open to the directory containing your files.  Click and drag the directory from one drive to another.  Conversely if you want to copy just a selection of the files follow this routine.
    Create a duplicate named directory in the destination drive.  Select the file you wish to move and do so from directory to directory.
    In Bridge it is even easier.  In Bridge ensure that the Folders sub pane is open and visibile.  Just click on the source directory and click and drag it to the destination drive.
    Testing on my part (I routinely move up to 30 gigabytes at a time) has demonstrated that Bridge adds a little time to the process depending on the size of the source files.  I suspect that this has to do with additional overhead of the program.
    To be safe I would recommend that you do use the copy method instead of moving the directory.  This is a failsae in case any problems crop up during the process.  It takes mere moments to delete the source directory after the copy routine has run.
    Wayne Webb

  • Moving fields from one location to another location?

    Hello
    I hv developed my_form, having couple of subforms, fields.
    They decided to change the layout drastically, pls. let me know How I can MOVE fields as a BUNCH from one location to another location on a DIFFERENT page?
    Say, earlier i hv 5 fields together, side by side on a same line/row wrapped in my_sub_form on 2nd page. Now, after they revising they want to see these 5 fields of the my_sub_form on 3rd page, pls. let me,
    1) How can i move these 5 fields ALL TOGETHER as a bunch to another location, so that it meakes my life easy? instaed of moving a single single field.
    2) or i should move my_sub_form AS A WHOLE? i tried it not giving me a chance of moving as a my_sub_form?
    3) Pls. let me know what is Object Tool? where can i see on the form, i did RIGHT CLICK, but, did not see any such Object Tool on the displayed sontext menu?

    Hi,
    Best option would be to select the objects in the hierarchy and then drag them in the hierarchy to the new location. For example if you drag them over a page and release, Designer will place the objects at the end of that page's content.
    Hope that helps,
    Niall

  • How export one table along with data from one location to other location

    Hi All,
    I'm new in export/import practice.
    Can anyone plz tell the steps along with commands to do the following:
    1. I want to export a table with data from one location(computer) to other(computer) that are in same network.
    2.Also from one user to another user.
    I'm using oracle 10g.
    regards
    Sonia
    Edited by: 983040 on Feb 19, 2013 11:35 PM

    First of all read documentation
    Oracle Export/Import : http://docs.oracle.com/cd/B19306_01/server.102/b14215/exp_imp.htm
    Datapump Export/Import : http://docs.oracle.com/cd/B19306_01/server.102/b14215/dp_overview.htm
    If you are using Datapump or Traditional Export/import you need to follow following steps
    *1) Take User dump via EXPDP on Computer A .*
    For EXP
    exp username/password owner=Test file=D:\test.dmp log=D:\test.log
    For EXPDP
    expdp username/password schemas=TEST directory=TEST_DIR dumpfile=TEST.dmp logfile=TEST.log*2) Copy that to Computer B*
    *3) Import dumpfile.*
    For IMPDP  Use remap_schema optionhttp://www.acehints.com/2012/05/data-pump-impdp-remapschema-parameter.html
    For IMP use fromuser and touser option
    one user to another user imp

  • Moving Files from one project to another??

    New to Aperture ..and wondering is there an easy way to move files from one project to another? Or to move from one Album one project to another Album in another project if the Albums have the same name?
    thanks in advance,
    Steve

    schorney wrote:
    New to Aperture ..and wondering is there an easy way to move files from one project to another?
    Yes, simply drag-and-drop a thumbnail from a Project to another Project; or Option-drag-and-drop (one way copies the image, the other way moves the image).
    Or to move from one Album one project to another Album in another project if the Albums have the same name
    Although Albums can be located in Projects, Albums are really not "in" Projects as regards where the images come from. Each album is simply a virtual collection of pointers to images; the images pointed to can be located in multiple Project(s). So just drag-and-drop a thumbnail image from any project to an album to add a pointer for that image to that album.
    Although it seems complex it really isn't. Albums are a very powerful organizational tool with essentially zero overhead. Try it. Create some test albums in various ways just to see what happens and delete the albums when you are done. Since Albums consist of just "pointers" we can make/delete them at will for any reason.
    Note that Albums can be deleted with no warning message because Apple figures a simple collection of pointers is not that big a deal. Personally I think Album-deleting should have a (non-dire) explanatory warning message, because sometimes an album can consist of a complex collection of pointers.
    Multiple Albums should never have the same name.
    HTH
    -Allen Wicks

  • HT201236 I want to do something so simple that there are no instructions. I just need to have two windows open at the same time so I can transfer files from one to the other by drag

    I want to transfer files from one device (or page ) to another by drag and drop , so i need two windows ope   at the same time,
    I know this can be done but I have forgotten how

    Don't use any full screen options for any app that has them
    Mount your device and double click on it to open it. Drag this window to the upper right of your Desktop and resize it to a bit less than half of your Desktop.
    Open the next folder and position it on the lower left side and resize it so you can still see the previous window.

  • How export one table along with daya from one location to other location

    Hi All,
    I'm new in export/import practice.
    Can anyone plz tell the steps along with commands to do the following:
    1. I want to export a table with data from one location(computer) to other(computer) that are in same network.
    2.Also from one user to another user.
    I'm using oracle 10g.
    regards
    Sonia

    Wrong forum. This is a database query not an Oracle Secure Backup issue.
    Thanks
    Rich

  • Moving files from one folder to another caused freeze

    I now have a list of files stuck in the center of my screen.
    I'm sure a reboot will fix this (I hope!) but I thought it was a bug worth reporting.
    All I did was move a copy a collection of files from one folder to another folder.  It made the "move" sound, and the files have been copied, but something clearly went wrong

    Have java.io.File objects pointing to the three folders. Get the list of all the files in the folder. Start a loop and check if the filename ends with Data.dat. If it is so then copy file to the final folder.
    To Copy file you can use any of the two approaches.
    1. You can read that file as byte stream (java.io.FileInputStream) and write it to the other folder as bytes (java.io.FileOutputStream).
    2. You can use shell commands to do this. (java.lang.Runtime.exe() method)
    Ali Ahsan

  • How ot move an flat file from one location to another

    Hi all,
    My requirement is that i am having a flat file in my C drive(ex:- C:\123.txt) i have to move that file into One of the folders of the My Netqork places using ABAP Programing
    How can i do this...Can we do this using OPEN DATASET   Plese give me sample code if having
    Regards
    Ajay

    Hi Ajay,
      There is no need for using Open Dataset.
    First you upload your text file using GUI_UPLOAD  from the present location.
    Then you download the file using GUI_DOWNLOAD into the required location(Netwrk Places).
    Check this link for GUI_UPLOAD and GUI_DOWNLOAD.
    http://abaplovers.blogspot.com/2008/03/function-modules-guiupload-guidownload.html
    If you are moving it onto Application Server, then go for
    Open Dataset
    Check this link for Open Dataset:
    http://help.sap.com/saphelp_40b/helpdata/ru/34/55cad198482bc0e10000009b38f91f/content.htm
    Hope this helps you.
    Regards,
    Chandra Sekhar

  • Moving files from one user to another

    Good afternoon all!
    In short I need to create a new user on a MacBook Pro running 10.7 (latest updates available as of this posting). However in the past when I have done this, when I moved the needed files (Photoshop actions, images, etc) over to the new user I kept getting permission errors which makes sense.
    So my question is simply, how do I migrate data from one user account to another while either modifying or fixing permission issues?
    Thanks!

    Copy all the data files into /Users/Share as the old user then log in as the new user and copy the files from /Users/Share to the home folder.

Maybe you are looking for

  • PLEASE, once and for all a solution for getting RECOVERY KEY

    First off, I would just like to say that I believe this is the STUPIDEST PROBLEM... Why the heck do we need even need a username, password... AND SOME SECURITY KEY THAT IS IMPOSSIBLE TO FIND? I have read all of the 100's of replies on this topic... A

  • Error while calling RFC adapter(FILE-XI-RFC scenario)

    Hi, I am trying for FILE-XI-RFC scenario. I am getting the following error. I have checked in message monitoring. The error is coming while calling the RFC adapter. Can any body tell what problem is this? Regards, Dhana   <?xml version="1.0" encoding

  • Using clone tool in Elements 12

    When I use clone tool, after sampling the area with alt key when I try to apply it the photo moves around so that I cannot not clone.  How can I fix?

  • Billing numbers based on CST & VAT for Invoice, Credit / Debit Memo's.

    Hi All, We are doing implementation for an Indian Client and we came across one requirement which required some customization. The requirment is as follows. 1. We have defined all States as Storage locations and these location have assigned to one pl

  • Deployment Server Will not Start

    I don't know what happened. I was working through the tutorials and had just finished populating the database. When I tried to run the example again I get the error The Sun Java Application Server 8.2 could not start. Possible reasons include: Port C