Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8984257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:03:20+00:00 2026-06-15T21:03:20+00:00

I have a bash script that backs up my iOS files over FTP and

  • 0

I have a bash script that backs up my iOS files over FTP and I’m getting a few problems, I’m just wondering if anyone could help me out?

Here’s my script:

  #!/bin/bash
  mkdir zipfolder
  cp /var/mobile/Library/SMS/sms.db /var/root/zipfolder/
  cp /var/mobile/Library/Notes/notes.sqlite /var/root/zipfolder/
  cp /var/mobile/Library/Safari/Bookmarks.db /var/root/zipfolder/
  cp /var/mobile/Library/Safari/History.plist /var/root/zipfolder/
  cd var/root
  zip -r zippyy.zip zipfolder

  HOST=HOSTNAME
  USER=USERNAME
  PASS=PASSWORD

  ftp -inv $HOST << EOF
  user $USER $PASS
  cd sms
  LIST=$(ls | grep zippyy*.zip)

  FILECOUNT=0
  for FILE in $LIST
  do
      if [ -f $FILE ];
      then
          FILECOUNT+=1
  done
  FILECOUNT+=1
  NEXTDB="zippyy$FILECOUNT.db"
  mv zippyy.zip $NEXTDB

  ftp -inv $HOST << EOF    
  put $NEXTDB
  bye
  EOF

  rm -f zippyy.zip
  rmdir zipfolder

I get the following errors:

  ?Invalid command
  ?Invalid command
  We only support non-print format, sorry.
  ?Invalid command
  ?Invalid command
  ?Invalid command
  ?Invalid command
  ?Invalid command
  ?Invalid command
  ?Invalid command
  ?Invalid command
  ?Invalid command
  (local-file) (remote-file)

  rmdir: failed to remove 'zipfolder': Not a directory
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T21:03:22+00:00Added an answer on June 15, 2026 at 9:03 pm

    Answer #3 for formatting

    Try something like this (totally untested!)

    #!/bin/bash
    
    ROOTFOLDER="/var/root"
    ZIPNAME="zipfolder"
    ZIPFOLDER=$ROOTFOLDER/$ZIPNAME
    LIBFOLDER="/var/mobile/Library"
    ZIPFILE="zippyy.zip"
    
    mkdir -p $ZIPFOLDER
    cp $LIBFOLDER/SMS/sms.db $ZIPFOLDER/
    cp $LIBFOLDER/Notes/notes.sqlite $ZIPFOLDER/
    cp $LIBFOLDER/Safari/Bookmarks.db $ZIPFOLDER/
    cp $LIBFOLDER/Safari/History.plist $ZIPFOLDER/
    cd $ROOTFOLDER
    zip -r $ZIPFILE $ZIPNAME
    
    HOST=HOSTNAME
    USER=USERNAME
    PASS=PASSWORD
    
    ftp -inv $HOST << EOF
    user $USER $PASS
    cd sms
    dir . remote_dir.txt
    bye
    EOF
    
    FILECOUNT=$(grep zippyy remote_dir.txt | wc -l)
    NEXTDB="zippyy${FILECOUNT}.db"
    mv $ZIPFILE $NEXTDB
    
    ftp -inv $HOST << EOF
    user $USER $PASS
    put $NEXTDB
    bye
    EOF
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have bash script that work for many files in loop. It compiles, check
I have a bash script that has set -x in it. Is it possible
I have a bash script that does ssh to a remote machine and executes
I have a bash script that cuts out a section of a logfile between
I have a bash script that sources contents from another file. The contents of
I have a bash script that simply calls different calls and redirect stdout and
I have a bash script that installs some software. I want to fail as
I have a bash script that uses growlnotify to send notifications. However, growlnotify doesn't
I have a bash script that has this function in it: function start_vi() {
I have a bash script that I need to write my password to run

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.