Find the answer to your Linux question:
Results 1 to 3 of 3
I'm writing a small script to automate the backup: -------------------------------------------------------------------------------------------------------- Problem: within the folder structure there're files and folders with Cyrillic characters: Example (this is not for bucking up the ...
  1. #1
    Just Joined!
    Join Date
    Mar 2009
    Posts
    5

    files with cyrilic filenames

    I'm writing a small script to automate the backup:
    --------------------------------------------------------------------------------------------------------

    Problem: within the folder structure there're files and folders with Cyrillic characters:

    Example (this is not for bucking up the mp3s; it's only an example):
    --------------------------------------------------------------------------------------------------------

    jenea@ubuntu-srv:/mnt/mount1/Russian Rock$ ll | grep mp3
    ls: Alisa - ?????? ?-95.mp3: No such file or directory
    -rwxrwxrwx 1 502 702 3471697 1999-04-04 13:00 Alisa - ?????? ?-95.mp3
    -rwxrwxrwx 1 502 702 3878791 2002-09-20 20:37 Alisa - Vereteno.mp3
    -rwxrwxrwx 1 502 702 4523714 2004-01-03 00:08 Aquarium_-_tyageliy_rock.mp3
    -rwxrwxrwx 1 502 702 9629696 2008-08-14 21:44 bumboks_-_vahtri.mp3
    -rwxrwxrwx 1 502 702 6096898 2001-08-24 13:00 Igor_Saruhanov_-_Skripka-Lisa.mp3
    -rwxrwxrwx 1 502 702 4218880 2001-03-14 06:08 Konec_filma_and_bashakov_mihail-alice.mp3
    -rwxrwxrwx 1 502 702 3045376 2007-02-08 23:18 Konec_filma-noch_odinochestva.mp3
    -rwxrwxrwx 1 502 702 3442703 2002-03-18 07:06 Kukryniksy - Po raskrashenoi dushe.mp3
    -rwxrwxrwx 1 502 702 3982443 2004-01-27 08:06 ????-????, ??????????.mp3
    -rwxrwxrwx 1 502 702 3919750 2001-02-04 12:00 ??????? - ???????.mp3
    -rwxrwxrwx 1 502 702 4627192 2004-01-02 22:34 Naiv - Superzvezda.mp3
    -rwxrwxrwx 1 502 702 6579226 2002-02-03 21:18 Nogu_svelo - Nashi_detskie_golosa.mp3
    -rwxrwxrwx 1 502 702 4653056 2002-05-05 19:57 Okean_elzy - vidpusti.mp3
    -rwxrwxrwx 1 502 702 6281926 2001-02-06 12:00 Ol'ga Orfeiva -Doroga_v_ray.mp3
    -rwxrwxrwx 1 502 702 3961000 2002-06-25 18:12 Petliura - Platie beloe.mp3
    -rwxrwxrwx 1 502 702 2944290 2003-09-15 12:53 V.Visockij-Aeroflot.mp3
    jenea@ubuntu-srv:/mnt/mount1/Russian Rock$

    This is what get when tarring it:
    --------------------------------------------------------------------------------------------------------

    jenea@ubuntu-srv:/mnt/mount1/Russian Rock$ tar -cvzf /home/jenea/test/test.tgz /mnt/mount1/"Russian Rock"/*.mp3
    tar: Removing leading `/' from member names
    tar: /mnt/mount1/Russian Rock/Alisa - ?????? ?-95.mp3: Cannot open: No such file or directory
    /mnt/mount1/Russian Rock/Alisa - Vereteno.mp3
    /mnt/mount1/Russian Rock/Aquarium_-_tyageliy_rock.mp3
    /mnt/mount1/Russian Rock/bumboks_-_vahtri.mp3
    /mnt/mount1/Russian Rock/Igor_Saruhanov_-_Skripka-Lisa.mp3
    /mnt/mount1/Russian Rock/Konec_filma_and_bashakov_mihail-alice.mp3
    /mnt/mount1/Russian Rock/Konec_filma-noch_odinochestva.mp3
    /mnt/mount1/Russian Rock/Kukryniksy - Po raskrashenoi dushe.mp3
    /mnt/mount1/Russian Rock/????-????, ??????????.mp3/
    /mnt/mount1/Russian Rock/??????? - ???????.mp3/
    /mnt/mount1/Russian Rock/Naiv - Superzvezda.mp3
    /mnt/mount1/Russian Rock/Nogu_svelo - Nashi_detskie_golosa.mp3
    /mnt/mount1/Russian Rock/Okean_elzy - vidpusti.mp3
    /mnt/mount1/Russian Rock/Ol'ga Orfeiva -Doroga_v_ray.mp3
    /mnt/mount1/Russian Rock/Petliura - Platie beloe.mp3
    /mnt/mount1/Russian Rock/V.Visockij-Aeroflot.mp3
    tar: Error exit delayed from previous errors
    jenea@ubuntu-srv:/mnt/mount1/Russian Rock$

    List of the tar contents:
    --------------------------------------------------------------------------------------------------------

    jenea@ubuntu-srv:~/test$ tar -tvf test.tgz
    -rwxrwxrwx 502/702 3878791 2002-09-20 20:37 mnt/mount1/Russian Rock/Alisa - Vereteno.mp3
    -rwxrwxrwx 502/702 4523714 2004-01-03 00:08 mnt/mount1/Russian Rock/Aquarium_-_tyageliy_rock.mp3
    -rwxrwxrwx 502/702 9629696 2008-08-14 21:44 mnt/mount1/Russian Rock/bumboks_-_vahtri.mp3
    -rwxrwxrwx 502/702 6096898 2001-08-24 13:00 mnt/mount1/Russian Rock/Igor_Saruhanov_-_Skripka-Lisa.mp3
    -rwxrwxrwx 502/702 4218880 2001-03-14 06:08 mnt/mount1/Russian Rock/Konec_filma_and_bashakov_mihail-alice.mp3
    -rwxrwxrwx 502/702 3045376 2007-02-08 23:18 mnt/mount1/Russian Rock/Konec_filma-noch_odinochestva.mp3
    -rwxrwxrwx 502/702 3442703 2002-03-18 07:06 mnt/mount1/Russian Rock/Kukryniksy - Po raskrashenoi dushe.mp3
    drwxrwxrwx 502/702 0 2009-11-28 20:01 mnt/mount1/Russian Rock/????-????, ??????????.mp3/
    drwxrwxrwx 502/702 0 2009-11-28 20:01 mnt/mount1/Russian Rock/??????? - ???????.mp3/
    -rwxrwxrwx 502/702 4627192 2004-01-02 22:34 mnt/mount1/Russian Rock/Naiv - Superzvezda.mp3
    -rwxrwxrwx 502/702 6579226 2002-02-03 21:18 mnt/mount1/Russian Rock/Nogu_svelo - Nashi_detskie_golosa.mp3
    -rwxrwxrwx 502/702 4653056 2002-05-05 19:57 mnt/mount1/Russian Rock/Okean_elzy - vidpusti.mp3
    -rwxrwxrwx 502/702 6281926 2001-02-06 12:00 mnt/mount1/Russian Rock/Ol'ga Orfeiva -Doroga_v_ray.mp3
    -rwxrwxrwx 502/702 3961000 2002-06-25 18:12 mnt/mount1/Russian Rock/Petliura - Platie beloe.mp3
    -rwxrwxrwx 502/702 2944290 2003-09-15 12:53 mnt/mount1/Russian Rock/V.Visockij-Aeroflot.mp3
    jenea@ubuntu-srv:~/test$

    Testing with cron:
    --------------------------------------------------------------------------------------------------------

    jenea@ubuntu-srv:~/test$ crontab -l
    # m h dom mon dow command
    41 * * * * tar -cvzf /home/jenea/test/test_cron.tgz /mnt/mount1/"Russian Rock"/*.mp3
    jenea@ubuntu-srv:~/test$

    Results
    --------------------------------------------------------------------------------------------------------

    jenea@ubuntu-srv:~/test$ tar -tvf test_cron.tgz
    -rwxrwxrwx 502/702 3878791 2002-09-20 20:37 mnt/mount1/Russian Rock/Alisa - Vereteno.mp3
    -rwxrwxrwx 502/702 4523714 2004-01-03 00:08 mnt/mount1/Russian Rock/Aquarium_-_tyageliy_rock.mp3
    -rwxrwxrwx 502/702 6096898 2001-08-24 13:00 mnt/mount1/Russian Rock/Igor_Saruhanov_-_Skripka-Lisa.mp3
    -rwxrwxrwx 502/702 3045376 2007-02-08 23:18 mnt/mount1/Russian Rock/Konec_filma-noch_odinochestva.mp3
    -rwxrwxrwx 502/702 4218880 2001-03-14 06:08 mnt/mount1/Russian Rock/Konec_filma_and_bashakov_mihail-alice.mp3
    -rwxrwxrwx 502/702 3442703 2002-03-18 07:06 mnt/mount1/Russian Rock/Kukryniksy - Po raskrashenoi dushe.mp3
    -rwxrwxrwx 502/702 4627192 2004-01-02 22:34 mnt/mount1/Russian Rock/Naiv - Superzvezda.mp3
    -rwxrwxrwx 502/702 6579226 2002-02-03 21:18 mnt/mount1/Russian Rock/Nogu_svelo - Nashi_detskie_golosa.mp3
    -rwxrwxrwx 502/702 4653056 2002-05-05 19:57 mnt/mount1/Russian Rock/Okean_elzy - vidpusti.mp3
    -rwxrwxrwx 502/702 6281926 2001-02-06 12:00 mnt/mount1/Russian Rock/Ol'ga Orfeiva -Doroga_v_ray.mp3
    -rwxrwxrwx 502/702 3961000 2002-06-25 18:12 mnt/mount1/Russian Rock/Petliura - Platie beloe.mp3
    -rwxrwxrwx 502/702 2944290 2003-09-15 12:53 mnt/mount1/Russian Rock/V.Visockij-Aeroflot.mp3
    -rwxrwxrwx 502/702 9629696 2008-08-14 21:44 mnt/mount1/Russian Rock/bumboks_-_vahtri.mp3
    jenea@ubuntu-srv:~/test$

    Note the tars are almost identical in size; as the files with Cyrillic chars were not backed up:
    --------------------------------------------------------------------------------------------------------

    -rw-r--r-- 1 jenea jenea 62975034 2010-01-22 13:57 test_cron.tgz
    -rw-r--r-- 1 jenea jenea 62975280 2010-01-22 13:52 test.tgz

    Question:
    --------------------

    What should i do to fix this issue? Renaming the files is not an option.

    Thank you.

  2. #2
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    So to be clear, in neither case do files with Cyrillic characters get backed up?

    It sounds to me like your console isn't supporting Unicode (or at least Cyrillic). I don't know of a specific fix to your problem, but let's try a different process.

    If you go to System -> Administration -> Language Support, you should have an option to install new languages. Go there and install Russian support. This _should_ install fonts that support Cyrillic and hopefully help you out.

    If this doesn't help, let us know, and we can try to find another solution.
    DISTRO=Arch
    Registered Linux User #388732

  3. #3
    Just Joined!
    Join Date
    Mar 2009
    Posts
    5
    - I never run gui on the servers; step with installing additional languages is not possible; unless i do it through aptitude; which package should i install?
    - "console isn't supporting Unicode" - are u talking about bash shell or the ssh client?...... I used cron to test the tarring of those files.... as you can see it failed.....

    i guess as a test i can install a test server with russian regional settings?.... but even if it works....I'm not sure what other setting will be affected.......

Posting Permissions

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