Home of the Squeezebox™ & Transporter® network music players.
Page 12 of 15 FirstFirst ... 21011121314 ... LastLast
Results 111 to 120 of 144
  1. #111
    Senior Member Tony T's Avatar
    Join Date
    Nov 2009
    Posts
    1,093
    Quote Originally Posted by mr-b View Post
    Tx but still problems if I add or replace the first line with #!/bin/sh


    tc@PCP-XLR-LMS:/mnt/mmcblk0p2/tce/backup$ ./backup.sh
    -sh: ./backup.sh: not found
    Try putting the command on one line in the script (without the \ line breaks. Might be a misplaced white space after the \)
    Tony
     SBTouch ♪ SBRadio ♬

  2. #112
    Senior Member mr-b's Avatar
    Join Date
    Feb 2007
    Location
    UK
    Posts
    524
    Yes the cmd itself works fine from the cmd prompt, the issue seems to be running the script.
    I always get:
    -sh: ./backup.sh: not found

    E2A: I found one issue, my Windows text editor had appended a ^M CR after #!/bin/sh. Luckily I remembered enough of vi to get rid of it.

    Now the script has a final issue vs the cmd line:

    tc@PCP-XLR-LMS:/mnt/mmcblk0p2/tce/backup$ ./backup.sh
    tar: removing leading '/' from member names
    usr/local/slimserver/prefs/
    usr/local/slimserver/prefs/favorites.opml
    ...
    usr/local/slimserver/prefs/clientplaylist_b827eb964894.m3u
    : No such file or directoryata.tgz
    tar: error exit delayed from previous errors

    vs the cmd line which works fine:

    tc@PCP-XLR-LMS:/mnt/mmcblk0p2/tce/backup$ tar -chzvf /mnt/mmcblk0p2/tce/backup/p
    CP_and_LMS_prefs_Backup.tgz /usr/local/slimserver/prefs /mnt/mmcblk0p2/t
    ce/mydata.tgz
    tar: removing leading '/' from member names
    usr/local/slimserver/prefs/
    usr/local/slimserver/prefs/favorites.opml
    ...
    usr/local/slimserver/prefs/clientplaylist_b827eb964894.m3u
    mnt/mmcblk0p2/tce/mydata.tgz
    Last edited by mr-b; 2020-09-13 at 04:25. Reason: updated results

  3. #113
    Senior Member Tony T's Avatar
    Join Date
    Nov 2009
    Posts
    1,093
    Attach the script as a file.
    Tony
     SBTouch ♪ SBRadio ♬

  4. #114
    Senior Member mr-b's Avatar
    Join Date
    Feb 2007
    Location
    UK
    Posts
    524
    Here it is - had to zip it.backup.zip

  5. #115
    Senior Member Tony T's Avatar
    Join Date
    Nov 2009
    Posts
    1,093
    Script looks ok, not sure why "/mnt/mmcblk0p2/tce/mydata.tgz" is being truncated to "ata.tgz" (: No such file or directoryata.tgz)
    Weird.
    All I can think of is to try setting the permissions again with chmod 744 backup.sh
    Tony
     SBTouch ♪ SBRadio ♬

  6. #116
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    3,364
    The file still has improper line endings and carriage returns in it, process the file with dos2unix.

    Code:
    $ file ~/Downloads/backup.sh 
    /home/paul/Downloads/backup.sh: POSIX shell script, ASCII text executable, with CRLF, LF line terminators
    $ dos2unix ~/Downloads/backup.sh
    dos2unix: converting file /home/paul/Downloads/backup.sh to Unix format...
    $ file ~/Downloads/backup.sh 
    /home/paul/Downloads/backup.sh: POSIX shell script, ASCII text executable
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  7. #117
    Senior Member Tony T's Avatar
    Join Date
    Nov 2009
    Posts
    1,093
    Good catch.
    (I made the mistake of just opening it in my Smultron text editor and forgot I had it set to convert to UTF-8 on open).
    Tony
     SBTouch ♪ SBRadio ♬

  8. #118
    Junior Member
    Join Date
    Dec 2009
    Posts
    20

    Pifi

    Thanks for this great pice of software !!

    I Just upgraded from 5.1 to 6.1 and added a "DAC+ HIFI PIFI Audio Sound Card I2S interface for Raspberry pi 3 2 B B+ PCM5122" to my raspi.
    Unformtunately i cannot chose an appropriate output-device under "Change Squeezelite settings"/ "Output setting". There should be a dropdown list where i could chose my dac soundcard (s.th like "sysdefault:CARD=sndrpihifiberry" that is shown in the log as possible output device). but there is only the option "equal". In section "Audio output device settings" i choose HifiBery DAC +. Under Card Control i disabled the internal audio.

    when i login through ssh and start squeezelite manually it works:

    "/usr/local/bin/squeezelite -n piCorePlayer -o sysdefault:CARD=sndrpihifiberry -a 80:4::1: -d all=debug -f /var/log/pcp_squeezelite.log"

    What am i doing wrong? Full Logs are on pastebin here pCP-2B-833f04-pcp_diagnostics.log
    and here pCP-2B-833f04-pcp_squeezelite.log and here pCP-2B-833f04-pcp_dmesg.log.

    thanks for help.

    PS: I found a workarround: I deactivatded alsa under tweaks .. than i was able to put in the output device instead of "equal"
    Last edited by Fabius; 2020-09-14 at 01:41. Reason: found workarround

  9. #119
    Senior Member mr-b's Avatar
    Join Date
    Feb 2007
    Location
    UK
    Posts
    524
    Quote Originally Posted by paul- View Post
    The file still has improper line endings and carriage returns in it, process the file with dos2unix.

    Code:
    $ file ~/Downloads/backup.sh 
    /home/paul/Downloads/backup.sh: POSIX shell script, ASCII text executable, with CRLF, LF line terminators
    $ dos2unix ~/Downloads/backup.sh
    dos2unix: converting file /home/paul/Downloads/backup.sh to Unix format...
    $ file ~/Downloads/backup.sh 
    /home/paul/Downloads/backup.sh: POSIX shell script, ASCII text executable
    Great - that was it! (The 'file' cmd doesn't seem to be present on PCP ('find' couldn't find it), but dos2unix was and it did the job - no more errors!) Tx!
    Sorry to interrupt the thread with such Shell Scripting 101 stuff.

  10. #120
    Senior Member Tony T's Avatar
    Join Date
    Nov 2009
    Posts
    1,093
    Quote Originally Posted by mr-b View Post
    Great - that was it! (The 'file' cmd doesn't seem to be present on PCP ('find' couldn't find it), but dos2unix was and it did the job - no more errors!) Tx!
    Sorry to interrupt the thread with such Shell Scripting 101 stuff.
    Another way to see the line endings is with cat -e
    Display non-printing characters and display a dollar sign (`$') at the end of each line.
    Control characters print as `^X' for control-X; the delete character
    (octal 0177) prints as `^?'. Non-ASCII characters (with the high
    bit set) are printed as `M-' (for meta) followed by the character for the low 7 bits.

    Code:
    tc@picoreplayer:/mnt/MUSIC/Other$ cat -e backup.sh 
    #!/bin/sh$
    tar -chzvf /mnt/mmcblk0p2/tce/backup/pCP_and_LMS_prefs_Backup_script.tgz /usr/local/slimserver/prefs /mnt/mmcblk0p2/tce/mydata.tgz^M$
    Last edited by Tony T; 2020-09-14 at 04:14.
    Tony
     SBTouch ♪ SBRadio ♬

Posting Permissions

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